Giter Site home page Giter Site logo

trekhleb / learn-python Goto Github PK

View Code? Open in Web Editor NEW
15.9K 741.0 2.6K 129 KB

📚 Playground and cheatsheet for learning Python. Collection of Python scripts that are split by topics and contain code examples with explanations.

License: MIT License

Python 100.00%
python python3 learning programming-language learning-python learning-by-doing

learn-python's Introduction

Hi there!

I'm Oleksii. I work as a full-time software engineer at Uber. In my spare time, I do open-sourcing.

Most of my open-source 🚀 projects below 👇🏻 are focused on one thing - to help people learn 📚. You may use these projects to learn about algorithms in JavaScript and get prepared for technical interviews, or to learn Python syntax and start experimenting with machine learning algorithms and the math behind them, etc.

There are also other projects that I've developed for fun but that you might find useful, like ✍🏻 okso.app online drawing app.

I also write 📝 articles about life, web development and machine learning.

Getting in touch

trekhleb.dev

Follow me on Twitter   Follow me on LinkedIn   Follow me on Medium

learn-python's People

Contributors

adamstiefel avatar clarkchiu avatar digitalduke avatar firebreath1001 avatar hfanahita avatar htsuyoshi avatar imaness avatar josedefreitas avatar psimage avatar r04922101 avatar trekhleb avatar tusharshandilya avatar vilmacio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

learn-python's Issues

Usage of this project to another project as a template

Hello, I am planning to create a project as learn-julia containing every basic of Julia programming language. I was searching for a project which I can use as a template and follow the sequences. This project seems like an ideal one to me. Can I use this project structure and everything as a template and for following the sequence for my own project?

Please do let me know.

如何入门python?

请问有没有相关的建议,或者链接来帮助我构建有关python的思维模式

Incorrect Info in datatype(string)

# +---+---+---+---+---+---+
#  | P | y | t | h | o | n |
#  +---+---+---+---+---+---+
#  0   1   2   3   4   5   6
# -6  -5  -4  -3  -2  -1

HEY ☺️ @trekhleb 👋,

In Chapter 3 . DataTypes (3.3 $tring)
You explain about String Index

Whereas In Line (76-80)
I found an Mistake

Pls 🙏 reCorrect

Info view The Problem
# +---+---+---+---+---+---+
# | P | y | t | h | o | n |
# +---+---+---+---+---+---+
# 0 1 2 3 4 5 6
# -7 -6 -5 -4 -3 -2 -1

I actually test python[-1] = n (_we get last char of string)`

Love❤️ Your Work on this Repo
REGARD
@prajwalkedari

Can I use this code for online lecture?

Hello. Thanks for releasing a good open source.
I'm Korean and I'm trying to teach Python online in Korea.
Would it be ok to use the code here as an example?
It's for commercial purposes. It's under the MIT license, but I think it's better to ask.

Fix Incorrect Comment in String Indexing Example

Hello,

I've noticed a small error in the comments of the string indexing example provided in the [src/data_types/test_strings.py]. The comment incorrectly refers to the sixth character of the string as the "Fifth character".

Current Code:
word = 'Python'
assert word[0] == 'P' # First character.
assert word[5] == 'n' # Fifth character.
Issue:
The comment for assert word[5] == 'n' incorrectly states "Fifth character" while it actually checks the sixth character of the string word.

Suggested Correction:
word = 'Python'
assert word[0] == 'P' # First character.
assert word[5] == 'n' # Sixth character.
Correction Explanation:
Python strings are zero-indexed, so the first character is at index 0, and the sixth character is at index 5. The proposed change corrects the comment to accurately reflect the character's position in the string.

I hope this helps improve the documentation/code for future readers. If it's okay, I can submit a pull request #83 with this minor fix.

Thank you for your attention to this matter.

Best regards,
fancling

Python

Add Data structures and algorithms also

خ

ES 8 - Babel Template

This is a ES 8 project template using webpack for Spck Editor Pro. This project template was made with the help of createapp.dev.

Building and Running

Pressing the ▶ button will call the command build-dev in package.json. If dist/bundle.js file does not exist, it indicates this may be the first run and install-dep in package.json will be called. The spck.config.json file controls which command to call when pressing ▶ (which can be modified in Run Settings).

Some packages like webpack, typescript, babel, react, ts-loader have been installed globally to save space, unfortunately other packages do not work when installed globally and must be installed in the project folder such as @babel/preset-env, and css-loader.

The task build-dev creates a development build of the project and generates:

  • dist/bundle.js

When build-dev finishes, the preview window will launch.

Limitations in Android

Due to security restrictions in Android, execute permissions on write-allowed storage is likely forbidden on most stock devices. This prevents some npm scripts from working properly as npm run rely on the use of sh which requires exec permissions.

The node program is also built as a shared library for compatibility with future versions of Android and can only be accessed from the terminal and not sh.

For these reasons, using npm run ... will not work from the terminal, but entering the command (webpack --mode development) directly in the terminal will work.

ActiveState project integration?

👋This is a great project! Thank you for all the work you've put into it!

I'd be interested in contributing a configuration file and some docs for it (as an option in or near the Prerequisites section your README.md) to your project but wanted to run it by you with context before just making a PR.

At the hack night meetups I've been going to, a lot of the people showing up want to learn Python but don't know where to start (or even where to look). But this is the perfect place to start, and to continue revisiting! 💯 💯

One thing we consistently run into though is getting up and running in the first place. Learning environments are extra tricky to navigate on those nights because during experimentation people have often ended up with different Python and Python package versions installed globally / locally / with pip / with apt-get, etc.

I think offering integration with an ActiveState project could be really helpful for people with difficulty getting started and people like me trying to help out on hack nights.

Here's the documentation addition I'm imagining:


On Linux and have ActiveState's state tool?

Run state activate from the project directory


And here's what the config file looks like as an activestate.yaml:

name: learn-python
owner: shnewto
languages:
- name: python

The general idea is that with an account on https://platform.activestate.com/ you can preconfigure a Python (or Perl) environment with whatever packages you want and it builds a binary you can install. The state tool works as a kind of a "meta venv" for those preconfigured environments so you don't have to install your project's dependencies system wide (Windows and macOS support on the way).

Here's a link to the learn-python project I created https://platform.activestate.com/shnewto/learn-python
(it does require creating an account to view while we're in the early stages of building all this up 🙃)

Would be happy to answer any questions or to make a PR if you're open to it!

P.S. If you'd rather create your own project as and use that instead of the shnewto/learn-python project I put together that'd be great too! If you did the configuration file might look something like this:

name: learn-python
owner: trekhleb
languages:
- name: python

Translation request

Hello 👋.
I've found this project and thought it is quite cool. The examples in it are very helpful. Because of that, I'd want to translate the README file into Spanish (the same way as the Portuguese translation: in the root directory and in a file called README.es). As I see there's a translation into Portuguese, I thought maybe a translation into Spanish would also be good. I'm a native Spanish speaker who has previously contributed to open-source projects and repositories.
I'm opening this issue to let you know about this and receive a response from you: if you're interested, tell me so I can work on it. If not, you can close this issue.
Thank you in advance!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.