Here’s the brutal truth about learning Python as a beginner:
There are WAY too many resources, books, tutorial videos and blog posts out there and some are crap, not in-depth or too hard for you to understand.
If you are serious and want to learn Python effectively, you will need to know how to filter out junk, get help from other programmers or online programming communities.
If only it were that easy for you with little or no knowledge of any programming knowledge.
Well, today 6 experts will show you the best way to learn Python, how to get help when you are stuck and how to start writing awesome programs from any Python tutorial.
Here are what they have to say.
I started learning Python when my main programming language was Java, and I decided that I want to be programming in a language that provides readability and fast prototyping-time (a popular comparison between the two languages is their respective “print” statements).
Right from the beginning,
I found myself enjoying writing code in Python, as the Python syntax is not only considerably straightforward and intuitive but also consistent, in the sense that if specific syntax works for a specific data structure, we can expect it to work for other similar data structures as well – one example would be the built-in function len(), which returns the length of a Python list, tuple, string, set, etc. whereas in Java there are different syntaxes such as [variable].length, [variable].length(), or length([variable]).
In terms of how to effectively learn Python, same as how to effectively learn any programming language, practice makes perfect.
I personally familiarized myself with the Python syntax by going through the Codecademy’s online guide to Python, but other similar tutorials and guides would also work just fine.
After this first phase, it is crucial to maintain a certain level of constant exposure to Python.
This could be going through intermediate and advanced tutorials or programming books or challenging yourself with competitive programming problems (websites that provide these problems include Project Euler, HackerRank, CodeFights or dailyprogrammer).
While tutorials and books provide an instructional view on different programming topics that give you a deep understanding of the way a specific aspect of the language works, competitive programming offers a fun and challenging approach to learning different computing techniques, data structures, and libraries through finding the solution to different programming problems.
Neither of the two strategies is undesirable, and the combination of both would provide a well-rounded knowledge of a programming language.
The key is to simply keep programming, to keep your mind fresh of the language syntax, and to improve your problem-solving thought process.
Working on your own projects, or being a part of the open-source community is an irreplaceable aspect of programming, even more so for a language like Python, where the community is still growing at an incredible speed, with new libraries and projects implemented and worked on every day.
Through the process of learning, say, a new Python library, you would not only continue to familiarize yourself with the language but also add to your knowledge different ways to approach a problem in the future.
Working with others on an open-source project would help you actively research and learn more in-depth about a specific topic, and at the same time increase your professional network and credibility.
Why follow: Quan Nguyen is an international student from Vietnam, studying Computer Science and Mathematics with a minor in Philosophy at DePauw University, Indiana, U.S.A. He started programming 2 years ago with Java, and later I found himself looking for other programming languages that emphasize on readability and consequently quick prototyping-time, and soon after, Python became his favorite language.
He is deeply interested in the fields of data science and machine learning, specifically sentiment analysis from text. He is also considerably interested in face and object detection.
Main email: nguyenminhquan135[@]gmail[dot]com
Student email: quannguyen_2019[@]depauw[dot]edu
Phone number: +1 (765) 721-5818
Before diving into the topic I would like to thank you for inviting me to your “expert roundup post”. But let me tell you that I am not an expert in Python. I have just started to learn it. But I will try to answer the question to the best of my knowledge and experience.
According to me, the best way to learn any programming language is by picking up a problem and then trying to solve it with the programming language.
Now to be able to solve a problem you need to understand the problem itself very clearly. I mean you need to understand the inputs, outputs, constraints, rules and many other things.
So here are some steps that I recommend:
Understand the basics of Python
Understanding the basics of any language is very important. You should familiarize yourself with the input and output obviously.
Also the different data structures in Python like list, tuple, set and dictionary. Get yourself acquainted with loops and list comprehension.
The book Learning Python 5th edition by O’Reilly and Google’s Python online tutorial will help you a lot here. Alongside reading, you should also code along with the tutorial or concept that you’ve learned. Let’s say you learned input and output today, then write at least one program so that you can implement that. But do not overdo it if you have familiarized yourself with that.
Now that you have learned the basics of Python, start a project.
The project can be anything. From a simple GUI calculator project to designing a sophisticated AI that can distinguish if a message is “spam” or “ham”.
It can be anything.
One beginner-friendly site that can help you, in this case, is Automate the Boring Stuff with Python. In case you are a beginner in AI or data analysis stuff you can look here. If a project seems too hard then you can use anyone of 2 techniques that I use –
- Break the problem until you can solve all the sub-problems.
- Leave the problem and do some easier problem which is related to the original problem and then comeback to the original problem.
Googling for help is fine. But try to be independent. Write a code by yourself and then see how others have written it.
Compare your code with other codes
Assuming that you are a beginner; you are most likely going to write a code that is slow and huge. This is why you should read code written by others. Check out GitHub and other open sourced Python project.
Learn about Python modules and libraries
Since Python has a huge set of libraries and modules that are freely available you should familiarize yourself with at least NumPy, SciPy, Pandas, Matplotlib etc.
These libraries along with many others have so many functionalities in them that you have to least worry about writing an algorithm like Naive Bayes classification from scratch. Also using libraries makes your code much smaller and easier to read.
Hi, I’m Meenakshi Agarwal, a computer science graduate and have deep experience in Software product development and testing. Since I have a passion for programming and writing, so I started Techbeamers which is an e-Learning platform for programmers, tester and many other IT professionals around the world.
During the course of my career, I’ve learned many programming languages. But Python is the one which I like the most. It is because I’d mastered it with self-learning. I didn’t go through any online/offline training program. However, the online tutorials and a few books helped me achieve the goal of learning Python.
Before you get along with me to find out the most effective ways of mastering Python, you must know why you should learn it.
Here are a few reasons that are more than enough to convince you.
- Python is so simple and straight-forward. You can almost read and write it like pseudo-code.
- It has a rich support of built-in as well as third-party frameworks and libraries.
- Next, there is a strong Python community that helps in getting answers for any programming related query.
Let’s now see how you can learn it quickly.
1) First of all, target the core of the language. It is nothing but the basic building blocks like syntax, simple data types, variables, keywords, conditional (if…else) and control statements (e.g. loops).
2) Once equipped with the basic skills, write simple programs like factorial, Fibonacci series, odd/even numbers, interest calculator etc. Practice a lot.
3) The next step is to target the special data structures like list, set, tuple, dictionary. Again use these skills to solve some real-time problems and make programs using these constructs.
6) Learn about Python Modules and Libraries. Python has so many libraries not directly included, but so easy to install, that there is absolutely no reason to reinvent the wheel.
7) The time now is to help others learn Python. It is one of the best ways to strengthen the concepts you’ve learned i.e. teach someone else.
8) Participate in discussion forums and help fellow members out with questions they have. Join communities and consider answering questions on StackOverflow or Reddit.
9) Finally, choose a domain for professional development. For example, you can take up machine learning. It’ll require you learning about some third-party libraries and packages like Pandas, NumPy, SciPy etc.
Why follow: Meenakshi Agarwal is the Co-Founder of TechBeamers.com. She’s a Computer Science Graduate from Lucknow University and a Master of Computer Applications (MCA). She has worked with large MNCs and spent years doing Software development, product design, testing and automation using C/C++, Visual C++, Python, Java, J2EE, C#, DotNet, Selenium, FitNesse, and a number of other technologies. You can join any of her online communities Google+, Facebook, and Twitter.Show your appreciation by thanking Meenakshi Agarwal on Twitter. She is waiting to interact with you.Click To Tweet
If you compare with other programming languages like C, C++, and Java, Learning Python is very easy, at least, to begin with…
There are two Python versions – Python 2.x and Python 3.x. Choosing the right version of Python to work with is like spinning wheels.
There are so many established projects by giant product based companies using Python 2.x. So if you want to get into these projects, Python 2.x. is the right choice. If you are not sure, Python 3.x is good to go with as per future career perspective.
The two things you should indulge in if you want to learn Python effectively are:
- Prominent Data structure in Python
- Handling Python Libraries
The data structure includes String, List, Tuple, Dictionaries….
Find out the difference between them?
Which structure when to use and their various associated methods to manipulate the data.
The core strength of Python programming is Libraries. There are enormous libraries available for various projects.
For instance, if you want be a Data Scientist, there are many modules and libraries like Panda, Numpy, Tensoflow… Find out your area of project interest and explore respective libraries. These libraries are FREE to use.
For practicing programming, follow this routine:
- Create one directory to save all your Python programs.
- Starts building small projects. Such as – if you are learning GUI, develop a calculator – for web scrapping, scrap and analysis data from any social networking websites….
- Write utility functions as one Python program
- When you move forward, use those utility functions as a module in your new Python program. (Reusing code is good practice and saves your lots of time.)
Creating something out of your small projects motivates you, gives worth of learning and keeps you going. Feel happy and reward yourself. That’s necessary to keep your interest alive for Long-Term Learning!
Learning any programming language is not about knowing all the Syntax. You should know the power of your programming language. What are the things you can accomplish with the programming language? Once you know that, you can always Google the syntax.
The more you practice, the better you become in programming.
Why follow: Aniruddha Chaudhari is a master of Computer Science (from NIT Trichy, India) and Founder of CSEstack.org – Programming and Computer Science Portal. Python is his first and most preferred language. Apart from that I also dabble in multiple programming languages like C, C++… He has some awesome Python tutorials on his blog. You can follow any of his online communities on Facebook and Twitter.Thank Aniruddha Chaudhari for his tips. He would also love to interact with you now. Click To Tweet
Krishna Kant Mishra
My name is Krishna Kant Mishra and I like watching cricket, solving mathematical puzzles and listening to music. I am an Indian by nationality and a computer science engineering graduate. I’m currently working as VMWare/Cloud administrator in Wipro Technology.
How to learn Python effectively- The best way.
The most important question to answer first is why do I want to learn Python?
Answering this would be your ultimate guide.
Learning the basics of Python is easy, but applying the knowledge gained can be difficult. I’ve tried to learn to code without context and application, and I’ve almost never come out of it with any meaningful skills.
Here are my tips to learn Python effectively:
First, learn Python syntax
You need the basics, I am not disputing that. You should have the basic syntax somewhere in the back of your mind, so you vaguely know:
“Hey, couldn’t you somehow work with strings with the [:] operation?”
Unless you know the basic syntax, it’s hard to implement anything. That said, don’t spend too long on this. The goal is to learn the very basics, so you know enough to start working on your own projects in your areas of interest.
For reference, I spent less than a week on codecademy, and went through the basics in Python. This was enough to get started on a project.
Go through as many tutorials
Let say I want to learn about SQLite database in Python.
I first search for tutorials on google and scan through the search results and pick the tutorials that are in-depth and easier to understand.
I usually convert the online tutorial to PDF using “Print Friendly & PDF”(a google chrome extension) so I can read the online tutorial offline. Books are not left out, I also pick books that are well explanatory on the particular topic( SQLite database in Python).
During the learning process, if I get stuck, I ask other Python programmers in communities such as Reddit, StackOverflow, and Quora to help put me through.
When am through, I think of a project I can work on like storing data I scraped from the web in a database.
My principle is that just don’t read the tutorial, you need to experience the code with your fingers, otherwise you will forget it
Work on projects on your own
Though I have said a little about this I would like to emphasize more on projects.
Okay, you have a basic knowledge of Python syntax and you just finished a tutorial on a topic in Python. Now wet your ears by starting a project.
Your project could be anything.
- Automate something (Practical Programming for Total Beginners)
- Program something you find interesting, like data analysis (which I find interesting, like here) Python Programming Tutorials
The important thing to note is: Tutorials aren’t forbidden 😉 Just much tutorials about the BASICS are forbidden. So for example, Python Programming Tutorials is okay to look at when you try to do a specific project.
But try to become independent, see first how you would solve something on your own, and then look how others solved it!
Revise the basics from time to time
It is not bad going through the basics, finding out which methods are obsolete. So, just again check how you can use dictionaries, or how you can use the slice operator to reverse a string and whatever.
What to do when you realize that your code is bad
At this point, you can start comparing your code with others. When comparing, keep the following questions in your mind:
- How do I make my code faster?
- How do I improve my code?
At the end of the day, Python is evolving and changing all the time. There are probably only a few people who can legitimately claim to completely understand it. You’ll need to be constantly learning and working on projects.
If you do this right, you’ll find yourself looking back on your code from 6 months ago and thinking about how terrible it was. If you get to this point, you’re on the right track.
Python is a really fun and rewarding language to learn, and I think anyone can get to a high level of proficiency in it if they find the right motivation.
Cliff John Hill
Python has been designed from the beginning to be an easy language to learn. The most effective way is to take a simple online class on the basics, like Google’s Python Class, or one from Codecademy. Even the Python Tutorial from Python.org works.
All you need from these is to grasp the simple syntax and basic concepts.
From there, I would recommend finding an Open Source project that interests you and just diving in.
Further training can come from the PyCon lectures, which almost all of them are available online on YouTube. While a more focused list is on Python Mush Watch videos I recommend videos by Raymond Hettinger above the others (he’s just really good at doing engaging lectures), but David Beazly, Brandon Rhodes, Guido van Rossum, and Ned Batchelder all give good lectures as well.
An awesome book to start with would be “Python Crash Course”, as it quickly gets you up to speed with the basics and then jumps into some practical programming examples using Python.
I hope you gained a lot from these experts. Below is a video by Techy Help on the easiest way to learn Python.
Resources available for you to learn Python.
Below are some valuable resources that can be of help to you.
Python official documentation
Best books to learn Python
- Starting Out with Python by Tony Gaddis
- Python Crash Course: A Hands-On, Project-Based Introduction to Programming by Eric Matthes
- Learn Python the Hard Way by Zed Shaw
- The Python Standard Library by Example by Doug Hellmann
- Automate the Boring Stuff with Python by Al Sweigart
- Think Python by Allen B. Downey
- Dive Into Python 3 by Mark Pilgrim
Podcasts for Python programmers
- Talk Python To Me Podcast hosted Michael Kennedy
- PythonBytes hosted by Michael Kennedy and Brian Okken
- Podcast.__init__ hosted by Tobias Macey
- Import This: A Podcast for Humans hosted by Kenneth Reitz and Alex Gaynor
- Test and Code Podcast
Newsletter for Python programmers
- Pycoder’s Weekly
- Python Weekly
So…What Do You Think?
Now I want to hear from you.
What do you think of the learning tips shared?
Or maybe the experts missed out on some things.
Either way, leave a comment below right now to let me know.
Here’s How to Get The Most From This Guide
I put together a PDF version of this post to help you get the most from the tips shared here.
That way you can refer back to it whenever you need.