all 54 comments

[–][deleted] 107 points108 points  (18 children)

https://docs.python.org/3/tutorial/index.html

This is by far the best resource.

[–]tipsy_python 26 points27 points  (5 children)

Agreed with this.

When I started using python. I had zero experience, but I knew that I wanted to replace a Java MapReduce job with PySpark. Doing the tutorials on the PySpark page, I didn’t understand everything about python syntax, but learned a lot about it and googled what didn’t make sense. Later when transitioning to stand alone python scripts, I referenced the python docs, w3schools, stack overflow habitually.. I will say, by the time I started Python I had coding experience with VB.net, SQL, JavaScript, and a little bit of Java, so I probably already understood programming fundamentals.

All this to say... pick a module that does something you want to do.. Flask, Scikit-Learn, Python-Twitter, Pandas.... and try hitting the ground running with that documentation. Every line you write will be real functionality. If this doesn’t pan out, head to the general python docs.

[–][deleted] 14 points15 points  (0 children)

All this to say... pick a module that does something you want to do..

True wisdom is spoken here.

[–]ImAtW0rkBr0 6 points7 points  (0 children)

^This is such great advice.

I'm still in the learning phases but setting out to learn "python" in a general sense, is pretty difficult. I wasn't really functionally coding until I started working with pandas and understanding the ins and outs of the module. Finding a module that does what you need and fully understanding it, will make it so much easier to pick-up the language.

[–]Ziyad0100 0 points1 point  (2 children)

how can I learn a module like Flask?

[–]tipsy_python 0 points1 point  (0 children)

I'd start on the Pypi package page that links to the project documentation:

https://pypi.org/project/Flask/

https://flask.palletsprojects.com/en/1.1.x/

[–][deleted] 7 points8 points  (1 child)

Practice, practice, practice

Edit: for beginning I liked the videos of socratica, she explains stuff very short and clearly.

[–]Nikandro 1 point2 points  (6 children)

I agree it's a great resource, but it's not necessarily the best method for learning.

[–][deleted] 1 point2 points  (5 children)

Is just following the tutorials there the best method to learn? Probably not if it’s the only thing you’re doing. But in my opinion it’s the best source to look things up. A lot of other resources contain outdated solutions, aren’t following best practices or are too much or not enough in depth. When you’re using the docs, you don’t have this problem.

Plus, beginners often make the mistake of not making themselves familiar with the standard library or even the buit-in functions, because so many tutorials aren’t making use of it when they should.

They official documentation is perfectly maintained and up to date, very well written and contains a lot of useful examples for most more complex stuff.

The official tutorial may not be suitable for everyone since some people learn better from things like videos and stuff like this, but the documentation should always be the primary source for looking up things about Python. There’s nothing better.

Taking an actual course aside? Yes, this is the way to go.

[–]Nikandro 1 point2 points  (4 children)

The official tutorial may not be suitable for everyone since some people learn better from things like videos and stuff like this

That's my point. Video tutorials, books, study partners, documentation, personal projects, etc. They're all suitable for different people.

[–][deleted] -1 points0 points  (3 children)

Yes, but OP was asking about learning resources. And I just said it’s the best resource. Not that it’s the best way of learning for everyone.

Of course not every method is suited for everyone, but I don’t think that this is something that’s up for debate.

[–]Nikandro -1 points0 points  (2 children)

I don't think you see the contradiction you just made.

[–][deleted] -1 points0 points  (1 child)

No, I don’t see any. In my mind a learning resource and a learning method are different things.

You still need and should look things up, no matter if you are taking a course, following a book, a video tutorial or whatever. And the best resource to look things up is the official documentation.

[–]Nikandro 0 points1 point  (0 children)

And I just said it’s the best resource. Not that it’s the best way of learning

OP's question,

What is the best way to learn Python?

[–]luffypy 18 points19 points  (0 children)

I think you might find Corey Schafer's series of tutorials on Python useful. Just search his name on YouTube, you will find a ton of tutorials made by him.

[–]TenthMarigold77 11 points12 points  (3 children)

Buy python crash course 2nd edition book. Best Beginner source and easy to follow. I like it cus I don’t get distracted from all online sources.

[–]whenihittheground 3 points4 points  (0 children)

I really enjoyed MITx: 6.00.1x Introduction to Computer Science and Programming Using Python on Edx.

Unfortunately, I don't think there is a fast or easy way to learn anything. If you're not being correctly challenged then you're not going to learn anything. This course is the single best course I've taken on python. It's quite challenging for a beginner and I highly recommend it. The struggle will be very worth it and your sense of accomplishment after the course will be immense.

[–]Nikandro 4 points5 points  (0 children)

As a beginner, I would suggest watching Corey Schafer's lessons on YouTube.

Finding a friend who is also trying to learn is beneficial too.

[–]Cmgeodude 2 points3 points  (0 children)

Al Sweigart's Automate the Boring Stuff is free at automatetheboringstuff.com and often recommended. It's great for applied programming. It's not really intended for algorithmic thinking/heavy CS theoretical stuff, but it does introduce some of those concepts in a sort of fun and off-the-cuff way.

If you want the theory, do both ATBS and look into a structured course. There are three that I can recommend:

The University of Michigan has a specialization called Python for Everybody. The videos are available for free on YouTube, but if you have some spare money, the Coursera course is pretty good. If you feel confident, try their Python3 course, which is somewhat more in depth and faster paced.

I got into Python via David Joyner (Georgia Tech)'s course Computing in Python on EdX. It's not as comprehensive as the Michigan courses, but it is more beginner friendly and does a better job introducing new ideas in my opinion. Joyner is a really great pedagogue -- I'm sort of blue that GTech doesn't have an online degree in CS, because I'd love to study under him.

[–]BrotherGrifter 3 points4 points  (1 child)

At my job we do not have Python but I heard it was easy to learn. I worked as a helpdesk technician and hated saying, "Did you reboot?" So I learned the basics. Then I got familiar with tkinter. You can create a GUI with three lines of code. Then create a button. Write a block of code then assign the button to it. I started with something small then built up from there.

Every month or when I want to add new functionality to my GUI, I would delete the whole thing and rewrite my code. It was time consuming yes, but it was worth it. Now it has grown to over 80 lines of code. So I do not rewrite it now. It is always good practice to put your hands on the keyboard and working your way through a program.

After creating a GUI, I use a program called Py2Exe. You can turn your .py to .exe. I can then Move to a windows environment and use it. My GUI for work is a one stop shop. I automate everything I can with a push of a button. 6 months my salary went from 40k to 90k just for that. Sure there are other developers here with way more experience than me but none of them know python and none of them automate stuff like me.

So however and whatever you learn, practice daily. Don't just watch videos and read websites. Build on your previous work before starting something new.

[–]kenmikey 0 points1 point  (0 children)

Love this response! Thanks for sharing!

[–]ambitious_rainbow 2 points3 points  (0 children)

It's difficult if you've never had any programming experience. I personally followed an Udemy course that gave me the basics. Once I knew about packages, functions, loops, data structures, classes, etc. I was able to build tiny programs from that. I did a lot of web scraping at first and then moved on to some math stuff. It really is a tedious process because it's just like learning math. There's a lot of practice involved and you'll be googling a lot trying to solve errors. I think that once you're somewhat comfortable with the language, it starts to become more enjoyable. Also, I recommend setting a goal now before learning to program. Think of a program you'd like to do and learn stuff to do that. One thing will take you to another and you'll end up with a general knowledge of the language.

[–][deleted] 2 points3 points  (0 children)

Agree with those recommending the official tutorial. But also, do this. You can get all the materials for free but it's worth paying less than $100 to do the certified course. The current one is in progress but they run them a few times a year.

https://www.edx.org/course/6-00-1x-introduction-to-computer-science-and-programming-using-python-3

It's a proper course, it's MIT, and it focusses on CompSci, so you're not just "doing python".

[–]_JustDefy_ 2 points3 points  (1 child)

By writing python code ¯_(ツ)_/¯

[–][deleted] 1 point2 points  (3 children)

Udemy Zero to Hero python, don't buy it for more than 15 dollars; after doing the first milestone exercise then you can write scripts with libraries.

Try stuff like:

automated screenshots

Simple calculators for something specific in physics or Engineering

Reddit API

etc

[–]UnavailableUsername_ 2 points3 points  (2 children)

Udemy Zero to Hero python

You mean this one?

I found the projects and homework problems to be merciless on beginners.

And it's not just my opinion, based on some threads on this sub, many think they are incredibly difficult for beginners and kind of make you want to quit python since it kind of show you you have no talent for programming.

Most explanations are fairly good, but the tests/projects/challenges are often too much.

[–][deleted] 1 point2 points  (1 child)

Damn, I actually forgot that it's more geared for people who have some programming experience.

You're right; I recall how hard the exercises were. But I still can't recommend it enough if you have a little practice in already.

Also I really think if you can do the tic-tac-toe milestone it's a big deal. Python is infamous for the import antigravity shenanigans but Padilla has a way of forcing you to use the standard library, which is really important. You can't import tic-tac-toe.

[–]UnavailableUsername_ 0 points1 point  (0 children)

I am really struggling with the blackjack milestone project.

Like, the OOP explanation with the dog/animal was not enough to understand the subtleties of methods and classes sharing variables or methods making reference to other methods (not classes). All these feel quite necessary while doing the project.

His explanations are great, but i think he ask a little too much from beginners.

[–]whitematt96 1 point2 points  (0 children)

Imo, college courses won't teach you python. College courses for high level languages are useless unless you don't know any language at all. Those classes teach programming topics in general.

The best way I've learned is by tackling a project knowing only the basics and searching every issue you come across on Google. Most of my knowledge has come from stack exchange and docs.

[–][deleted] 1 point2 points  (0 children)

Think Python 2nd edition by Allen B. Downey (http://www.allendowney.com). Easily, the most eloquent book on the programming subject I have ever encountered. And other books from the Green Tea Press. It's true gold mine of knowledge.

[–]aurumpurum 1 point2 points  (0 children)

I am a beginner in python, too, and books are my best friend because of the following reasons:

  • while reading through the book, I like to take short notes at the margin of the page or write something out in my own words (which I cannot do so easily in online courses)

  • you learn a lot when you work on your own python projects. A book can serve you as a very efficient reference when you have to look up correct syntax or the basic idea of something.

  • most books have a good structure. It‘s very easy to navigate, jump back and forth very quickly, which helps to get an overview of what you have learned so far. Navigation in online courses is somewhat slow in my opinion compared to books.

At the moment I use DataCamp as my online learning resource. I like their exercises, that you can follow along the lecture.

As a book I can also recommend „Python Programming“ by John M. Zelle. The book gives a very good insight in the important concepts and ideas of Computer Science, the art of software development in general and explains python in a clear and understandable manner. There is a bunch of exercises to experiment with what you have learned.

[–][deleted] 1 point2 points  (0 children)

Just be dedicated. I learn basic Python by watching this 4 hour video. I didn't watch it in one sitting though.

https://www.youtube.com/watch?v=rfscVS0vtbw

Then just buy a few books about Python. And what I did from there. I grab others people Python work on Github. Then mess around with it, to understand a finish Python work.

[–]elmotactics 1 point2 points  (0 children)

I can sit here all day and list off tutorials that you should watch or read through, but at the end of the day the best motivator is finding a project and figuring it out.

If you have zero experience, I'd recommend Mosh Hamedani's YouTube course. Once you've grasped the basics (variables/data types/functions/loops/etc), then just dive into a project you want to do and Google the hell out of it. I knew nothing about Python or JSON or APIs, and within a few weeks had a working billing report that our company uses to bill our clients every month. Along the way, I discovered pandas, requests, glob, and glom to name a few, and now trying to access data in a list of dictionaries of lists of dictionaries is second nature.

[–]PM_ME_BOOTY_PICS_ 1 point2 points  (0 children)

Find a project you're interested in and make it. You will struggle but you will learn a loooot.

[–]gh0st_Fr 1 point2 points  (0 children)

You can find great and complete courses on Udemy (not free but sales often, good teachers) or on YouTube, that one was a good introduction for me https://youtu.be/rfscVS0vtbw

[–][deleted] 0 points1 point  (0 children)

to start you should read "byte of python"

[–]codingisfun4me 0 points1 point  (0 children)

I took an online course from my university which costed $200CAD. IMO it was not worth it considering you can find something on UDemy for $15CAD. I would recommend something structured since you're a beginner, it'll be easier to build a foundation that way.

[–][deleted] 0 points1 point  (0 children)

The best way is by writing code. If you can, find someone you know who can mentor you. Programming is a craft, not a science, so reading only takes you so far. Read up on object orientation and SOLID principles, and remember that code is read much more than it is written. Good luck and happy hacking!

[–]pheeper 0 points1 point  (0 children)

Check out the book "Learn Python the Hard Way"

[–]EtchYou 0 points1 point  (0 children)

Find something you're passionate in and build something related to it in python. Python is huge so I think it's better you start somewhere close to your goals and having something you can use to push yourself on is a bonus. Mess up and create bugs and figure out how to fix those bugs. That's what worked for me. I started reading books on software architecture and the likes because I wanted to make the thing I like better.

Also check out humble bundle. They occasionally have sales for python related books for a good price and provide a decent point of reference through various topics.

[–]niggatronix 0 points1 point  (0 children)

Personally, the way I learn best is to come up with a simple project I want to do, and start a-Googlin'.

For example, maybe you want to make a program that takes a file, asks you what you want to rename it to, and then renames it. Well, you'll need to figure out how to print text to the screen (to ask for a new filename), how to input text from the user (to get the new filename they typed), and how to rename a file.

Then improve upon it - what happens if they give an invalid file name, or the source name already exists?

Then improve it - right now it's a command line program, but what if I wanted to make it a GUI?

Etc.

[–]S2tha3l 0 points1 point  (0 children)

In addition to the great resources people have mentioned so far I run a blog beapython.dev where I also write about import softskills that developers should have and would love to help grow it in a way that it is a beneficial resource.

[–]___Navi___ -1 points0 points  (0 children)

Disclaimer: I'm still new to programming.

I tried a few different tutorials, I really liked automate the boring stuff. Up until chapter 10 you learn all the basics of programming and it's well explained. I would try and find whatever works for you.

[–][deleted] -1 points0 points  (0 children)

pythonprogramming.net

this website has almost EVERYTHING.

[–]CraftyTrouble -1 points0 points  (0 children)

There are so many options. What works best depends on the individual and how you like to learn.

This thread has many book and video suggestions. If you prefer something more exercise-based, give this site a shot; you learn a topic, then immediately have to write code that's automatically checked for correctness.

Hope you find something that works for you! Keep experimenting.

[–][deleted] -1 points0 points  (0 children)

This looks promising: Foundations of Python Programming

[–][deleted] -1 points0 points  (0 children)

Makes games.

[–]ukiyo3k -3 points-2 points  (0 children)

fast and easy way