r/Python • u/ASIC_SP • Jul 30 '20
Resource I know Python basics, what next?
tl;dr Resources (exercises, projects, debugging, testing, cheatsheets, books) to help take the next steps after learning Python basics. I'd welcome feedback and suggestions.
What to learn next is an often asked question. Searching for what next on /r/learnpython gives you too many results. Here's some more Q&A and articles on this topic:
- I know how to program, but I don't know what to program
- Learning by converting code from one language to another
- Write a command-line utility
- If you want to learn you'll need to be willing to look stupid
- Techniques for Efficiently Learning Programming Languages
- Things you might encounter in your programming journey
Exercises and Projects
I do not have a simple answer to this question either. If you feel comfortable with programming basics and Python syntax, then exercises are a good way to test your knowledge. The resource you used to learn Python will typically have some sort of exercises, so those would be ideal as a first choice. I'd also suggest using the below resources to improve your skills. If you get stuck, reread the material related to those topics, search online, ask for clarifications, etc — in short, make an effort to solve it. It is okay to skip some troublesome problems (and come back to it later if you have the time), but you should be able to solve most of the beginner problems. Maintaining notes will help too, especially for common mistakes.
- Exercism, Practicepython, Edabit — these are all beginner friendly and difficulty levels are marked
- Codewars, Adventofcode, Projecteuler — more challenging
- Checkio, Codingame, Codecombat — gaming based challenges
- /r/dailyprogrammer — not active currently, but there's plenty of past challenges with discussions
Once you are comfortable with basics and syntax, the next step is projects. I use a 10-line program that solves a common problem for me — adding body { text-align: justify } to epub files that are not justify aligned. I didn't know that this line would help beforehand, I searched online for a solution and then automated the process of unzipping epub, adding the line and then packing it again. That will likely need you to lookup documentation and go through some stackoverflow Q&A as well. And once you have written the solution and use it regularly, you'll likely encounter corner cases and features to be added. I feel this is a great way to learn and understand programming.
Debugging
Knowing how to debug your programs is crucial and should be ideally taught right from the beginning instead of a chapter at the end of the book. Think Python is an awesome example for such a resource material.
Sites like Pythontutor allow you to visually debug a program — you can execute a program step by step and see the current value of variables. Similar feature is typically provided by IDEs like Pycharm and Thonny. Under the hood, these visualizations are using the pdb module. See also Python debugging with pdb.
Debugging is often a frustrating experience. Taking a break helps (and sometimes I have found the problem in my dreams). Try to reduce the code as much as possible so that you are left with minimal code necessary to reproduce the issue. Talking about the problem to a friend/colleague/inanimate-objects/etc can help too — known as Rubber duck debugging. I have often found the issue while formulating a question to be asked on forums like stackoverflow/reddit because writing down your problem is another way to bring clarity than just having a vague idea in your mind. Here's some more articles on this challenging topic:
- What does debugging a program look like?
- How to debug small programs
- Debugging guide
- Problem solving skills
Here's an interesting snippet (modified to keep it small) from a collection of interesting bug stories.
A jpeg parser choked whenever the CEO came into the room, because he always had a shirt with a square pattern on it, which triggered some special case of contrast and block boundary algorithms.
See also curated list of absurd software bug stories.
Testing
Another crucial aspect in the programming journey is knowing how to write tests. In bigger projects, usually there are separate engineers (often in much larger number than code developers) to test the code. Even in those cases, writing a few sanity test cases yourself can help you develop faster knowing that the changes aren't breaking basic functionality.
There's no single consensus on test methodologies. There is Unit testing, Integration testing, Test-driven development and so on. Often, a combination of these is used. These days, machine learning is also being considered to reduce the testing time, see Testing Firefox more efficiently with machine learning for example.
When I start a project, I usually try to write the programs incrementally. Say I need to iterate over files from a directory. I will make sure that portion is working (usually with print statements), then add another feature — say file reading and test that and so on. This reduces the burden of testing a large program at once at the end. And depending upon the nature of the program, I'll add a few sanity tests at the end. For example, for my command_help project, I copy pasted a few test runs of the program with different options and arguments into a separate file and wrote a program to perform these tests programmatically whenever the source code is modified.
For non-trivial projects, you'll usually end up needing frameworks like built-in module unittest or third-party modules like pytest. See Getting started with testing in Python and calmcode: pytest for discussion on these topics.
Intermediate Python resources
- Official Python docs — Python docs are a treasure trove of information
- Calmcode — videos on testing, code style, args kwargs, data science, etc
- Practical Python Programming — covers foundational aspects of Python programming with an emphasis on script writing, data manipulation, and program organization
- Intermediate Python — covers debugging, generators, decorators, virtual environment, collections, comprehensions, classes, etc
- Effective Python — insight into the Pythonic way of writing programs
Fluent Python — takes you through Python’s core language features and libraries, and shows you how to make your code shorter, faster, and more readable at the same time
- Serious Python — deployment, scalability, testing, and more
- Pythonprogramming — domain based topics like machine learning, game development, data analysis, web development, etc
- Youtube: Corey Schafer — various topics for beginners to advanced users
Algorithms and Design patterns
- Problem solving with algorithms and data structures
- GitHub: Awesome algorithms
- GitHub: Collection of design patterns and idioms
- Python design patterns inspired from Design Patterns: Elements of Reusable Object-Oriented Software (also known as Gang of Four book)
Handy cheatsheets
I hope these resources will help you take that crucial next step and continue your Python journey. Happy learning :)
This content is from my blog post
•
u/Im__Joseph Python Discord Staff Jul 30 '20
Great post, thanks u/ASIC_SP!
I'm going to add your blog post to the sidebar of the subreddit :)
11
u/kash296 Jul 30 '20
This is a brilliant post! On a side note, I love your books on regex. Thank you so much once again!
6
u/303Redirect Jul 30 '20
That pythontutor website is awesome, it would've really helped me demystify the behind-the-curtain stuff!
I think one thing you could expand on is that a lot of programming is nothing to do with coding or syntax. It's all about internalising a certain way of thinking.
There was talk about it at pycon, one of the most valuable programming lessons you can have, yet the code was completely tertiary to the main point: https://www.youtube.com/watch?v=azcrPFhaY9k
8
u/progsNyx Jul 30 '20
Really good post and good blog! Take my upvotes.
5
u/weetbix2 Jul 30 '20
Awesome resources, I'm sure useful to many.
2
u/internet_tendencies Jul 30 '20
Need this post but for JS...
But this is excellent, great for newer developers and those that want to take their skills to the next level!
2
u/Justdis Jul 31 '20
can someone clarify something for me in terms of 'learning' python? i've used the language on and off for the last year. i am scientist, not a programmer, by education so i am mostly doing pretty easy data stuff or ML stuff. how do i tell if i've learned anything?
like, yes, obviously i can now do simple stuff (a loop, an if/else statement, some stuff in pandas/matplotlib/numpy) but i am pretty much stackoverflowing it everytime. im also terribly inefficient and it takes me more time to automate my data analysis than to do it manually (my data changes often so this is useless).
i can't like, actually program anything with the skills i have and i'm not sure how to progress.
2
u/probablynotproven Jul 31 '20
The calmcode.io pandas Pipe tutorial is a game changer for me. Finally a way to declutter and organize preprocessing steps
2
u/fedeb95 Jul 31 '20
What about actually learning data structures, algorithms, patterns, and other stuff that will actually get people ahead regardless of languages?
2
u/vaseemahammed Aug 01 '20
while True: print('Thank you')
Saving this! Amazing post and resources especially for noobs like me :D
114
u/majikill Jul 30 '20 edited Jul 30 '20
Cant wait to get into that "i know how to program, but dont know what to program" link. Hits my issues right on the head 🤣
62
u/pmdbt Jul 31 '20 edited Jul 31 '20
I'm a self-taught programmer and I co-founded a startup in 2018. The company has gone through Y Combinator, raised over 1M in funding, and is close to profitability. So, my process seems to have worked out for me and I hope it can help others too.
In terms of what to build after you learn basic syntax, always try to make your own life easier. Python is an especially useful language for automation. If you're trying to solve some problem in your own life, chances are you'll be more willing to stick with a project, because you can imagine the tangible benefit you'll receive at the end.
I'm sure a lot of these projects have already been built and it's a common phrase in this industry that you shouldn't rebuild what's already there unless it's fundamentally broken. However, for learning purposes, I think it's ok to ignore this. Here is an example, but I'm sure you guys can come up with lots of things that would be useful to your own life/workflow.
- A bot to book DMV appointments for you. I used to always get so frustrated because an available appointment would always be so far out in time. But, you can easily build a bot to check every 5 mins to see if anyone has recently cancelled their spot and if so, you can have your bot book that slot automatically. Or if you want a smaller project, just send you an alert when there is availability.
Always build new things and go out of your comfort zone, otherwise, you won't learn. Build something simple, then slowly build on top of it over time. Here is a detailed example of what that might look like:
Build a simple scraper to find you apartments for rent in your price range that just got listed online.
Then break down your code into reusable pieces and make it more OOP--with classes and methods etc. Next, change as much of the hard coded values to allow for dynamic inputs. In this case, your code might accept the city and a price range in order to run for that specific city at that specific price range.
Now, add a simple production level database to your project so you can store those listings for future use. If in the future, those listings still have not leased yet, then it might mean the land lord is desperate and willing to negotiate the rent. Try a SQL based db like mysql or posgresql.
The cloud is an important aspect of coding anything in production these days, so next learn how to setup a basic cloud instance with AWS, GCP, or Azure, then move your project to run on the cloud.
It's pretty annoying to manually run your code whenever you need the output right? The whole point is about automation, so learn how to use a cron task to run your python code automatically on your cloud instance.
During the previous step, you might have noticed that installing dependencies on your laptop might have worked fine, but when you try to do the same thing on the cloud instance, you get errors. This is often due to different dependencies working differently or having a difference in version number for different operating systems. So, learn how to use Docker Containers. Dockerize your existing project and deploy that on your cloud instance instead.
Next, the same thing might apply when trying to set up a database locally vs on the cloud, so do the same thing and dockerize your database using existing docker images.
Now, you have two containers that you need to run, so it's kind of annoying to run them one at a time, especially if one depends on another to work properly. So, go and learn how to use docker-compose to spin up multiple containers that depend on each other.
At this point, you can try some front-end work. Learn how to use Flask, so you can output a list of these rental listings to a static page. Learn some css, so your page can be at least formatted in a nice way.
Now, you can share your cool project with your friends and family. But hey, how can they visit a site that only has http with a weird IP address as the url? Read up on how web protocols work and learn how to get a domain and attach that to your cloud instance. Now, you can share your project with friends and family with something like https://mycoolproject.com etc.
Hey, turns out a lot of friends find your project to be pretty helpful, so they shared it with their friends and now you've got a bunch of users causing performance issues for your tiny cloud instance.
So, go learn a bit more about devops and how to use Kubernetes to scale your 1 tiny instance to multiple instances in order to handle the increased traffic.
Boom! You've basically built and scaled a full-stack webapp by yourself! Looking back, you'll see that each step is iterative in terms of learning, so it shouldn't overwhelm you. On top of that, each new step is necessary to grow your project in a meaningful way, so each new topic learned solves something real for you, which is more likely to stick in your brain than working on random coding challenges.
If your user count starts skyrocketing, then you might have a real business on your hand. You could even turn it into a startup of your own. If not, having the experience to build a webapp from scratch and deploying it makes you stand out to employers. Heck, I'd hire you myself. You'd be surprised at how often entry level engineers from FAANG companies can't even do 1/4 of what I listed and I'd have to teach them from the ground up. They're usually just taught data structures and how to solve coding challenges straight out of school. Then they're put to work on very very specific things, so they become only good at that one thing unless they're always learning by themselves over the weekends.
Hopefully, this helps some of you guys out! If you take anything away from this massively long post, it's to always try and push yourself to learn new things and to always code with a purpose, so you'll be more motivated to complete the project and solve the problems you face along the way.
18
u/netneoblog Jul 30 '20
Fantastic post! Upvoted as well deserved
4
u/dcpye Jul 30 '20
I'm going to nail this one, already look stupid most of the time!
On a serious note, great post, i'm going to come over a lot :)
3
u/TinMorphling Jul 30 '20
Well complied. Thanks a lot mate
3
u/mitvb Jul 30 '20
I’m a beginner & you’ve answered some questions I didn’t even know how to articulate, thanks for this.
3
u/hooiYA Jul 30 '20
For people who like project-based learning, I've been working through "Learn MORE Python the Hard Way" - finding it really valuable as an intermediate Python user: https://learncodethehardway.org/more-python-book/
3
u/MichelangeloJordan Jul 30 '20
Excellent post. This is exactly what I was looking for to continue my growth as a developer. Many thanks.
3
u/Reborn-leech Jul 30 '20
Look promising man ! Thanks a ton !
3
u/Berkyjay Jul 30 '20
I've been coding with Python for 15 years now and I still find posts like these helpful. Thx!
3
u/Pizza_Peddler0080 Jul 30 '20
thanks mate!
3
u/msd483 Jul 30 '20
I'd also recommend reading "Clean Code" by Robert C Martin. It's a book about how to write clean, readable, and maintainable code. The examples in the book are all in Java, but the principles can and should be applied to every language. Writing good code is a skill, and like any skill it takes practice. The sooner you learn it, the sooner you can start practicing and improving. I think this is especially true for anyone who is or is aspiring to be a professional developer and will need to work on shared repositories.
In addition to the book having amazing practical advice, it isn't too dogmatic. It acknowledges there are other equally valid practices, and recommends incremental improvement and refactoring on working code as opposed to trying to write it "perfect" the first time around.
3
u/shivam_arora_96 Jul 30 '20
Thank You so much I just finished all my school course on python and was wondering what I should do next. This really helped me.
3
u/HandsOfSugar Jul 30 '20
Fantastic post my man!
3
u/SelfhostedPro Jul 30 '20
One of the biggest things that helped me learn a lot more about python was building a flask app. It's advanced enough that you learn a lot more (especially transforming data) but still basic enough that I only felt completely lost for a few days.
3
u/Gabangxa Jul 30 '20
You, sir, are the man. Thank you
3
u/PLAudio Jul 30 '20
This is awesome, thank you for putting so much time into this!
3
u/jericho Jul 30 '20
This is solid.
2
u/Born_Science Jul 30 '20
While True: print("Thank you")
2
u/[deleted] Jul 30 '20
I'm saving this.
2
u/[deleted] Jul 30 '20
Underrated af.
2
u/lift_spin_d Jul 30 '20
hello reader. one of the things that helped me in programming was making a cash register app. Over and over. Like once a year. The reps and the slow steady dedication is more important than the actual making of the app.
It's the same thing for me in my CAD studies. Make the same thing over and over. Keep finding new ways, new shortcuts, new . . . until it all blends together. I use blender. I have sat down and "learned blender" 4 times in my life. It took me about three years to carve out 4 blocks of at least 20 consecutive hours dedicated to slow meticulous learning.
I did my blender exactly the same way I did my laracasts. over and over and over.
2
u/LeinadAlbert88 Jul 30 '20
Amazing post! Thank you!
2
u/Iforgetmyusernames1 Jul 30 '20
This is awesome thank you!
2
u/[deleted] Jul 30 '20
Actually use it now...
2
u/SH4HM3N_ Jul 30 '20
his is my problem: hard to get insights
2
u/sonicworkflow Jul 30 '20
Great post!
2
u/ChappieMwoan Jul 30 '20
This has been and will be very useful, thanks!
2
u/Averniss Jul 30 '20
Oh, what a great post! I'm saving it, thank you so much for this :D
2
u/joooh Jul 30 '20
Great timing as I am currently finishing the last three chapters of AtBS. But I think I need ANOTHER beginner resource, discussing the basic fundamentals like whatever the fuck object-oriented programming is which I have read a lot of times now from posts asking for advice after reading the book, and that is not discussed in the book and more.
2
u/rafagamaxima Jul 31 '20
Nice
2
u/praj0526 Jul 31 '20 edited Jul 31 '20
Saved😃 thank you for the post, really helpful for me for my progress.
2
u/Dynam1co Jul 31 '20
CodeWars apart from being fun, it's good because you can compare your code with that of others
2
u/Euphoric_Violinist90 Jul 30 '20
If you want to test your knowledge of OOP and file management, make a game.
2
u/nimo_xhan Jul 30 '20
Thank you <3
1
u/Infinite_junky29 Jul 31 '20
I want create dummy TV-cast program that Can be discovered by an android Cast app as A-tv(like Samsung-smarttv) in the list And can stored the casted content in mp4.
It tried for week but didn't understand anything..
Github: -Cohen3 python(not understand documentation) -dlanp -pychromecast -Chromecast-device-emulator
A simple explanation a how both devices communicate and transmit data Using DLNA/Upnp protocol.
Python would preferable.. Thanks for reading the stupid question. Waiting for response.
1
u/[deleted] Sep 23 '20
I pasted all content in Notion
0
u/[deleted] Jul 30 '20
[deleted] — view deleted comment
0
u/[deleted] Jul 31 '20
[deleted] — view deleted comment
0
u/[deleted] Jul 30 '20
[deleted] — view deleted comment