Home Articles Categories Series
Pythonise Just now

10 pro tips for learning Python

In this article, we share our ten best tips to help you learn Python


Article Posted on by in Python
Julian Nash · 9 months ago in Python

Python is without a doubt, one of the best and most popular programming languages for newcomers and experienced developers to learn. It's clear and clean syntax makes writing Python code a joy, coupled with a thriving community, vast range of open source libraries and a rich developer ecosystem making Python the ideal language to add to your code arsenal.

Whilst learning Python is undoubtably a lot fun, like learning anything new it can be challanging and frustrating at times. We've put this guide together from experience to help you along the way and think you'll find it useful!

Let's get into our top tips for learning Python.

Start learning for free

Rather than jump straight into a paid course or signing up to any learning platforms, consider using as many of the free resources available to learn some of the basics and build up a solid foundation of knowledge. This will help you a lot when it comes to taking the next step and signing up for a course, buying books or paying for tutorials as you'll be able to follow along with the course content!

Some great free resources include:

You'll be amazed how far you can get simply learning from all the amazing free content available online. Go ahead and explore some of the free resources listed above and get stuck in.

Figuring out your direction

Once you've started becoming familiar with some of the Python basics, it's helpfull to figure out what direction/field of programming you're interested in. This will vary depending on your goals and the types of projects you'd like to work on.

Let me just say that this isn't essential, it just helps you focus your learning so you can apply it to specific and guides you in the right direction.

Some popular fields of programming include:

  • The web (Websites, web applications, APIs etc.)
  • Internet of things (Micro controllers, connected devices etc.)
  • Desktop applications
  • Mobile applications
  • Data science & big data
  • Machine learning (Neural networks, sentiment analysis, image classification etc.)
  • Artifical intelligence

The reasons you decided to learn Python will likely be reflected in the kinds of programming fields you decide to persue. For example, if you want to work with the web, consider learning some of the well known Python web frameworks such as Flask or Django. Want to get stuck into some machine learning? Check out the major machine learning libraries such as Tensorflow or Caffe

If you're not sure what direction you'd like to head in, it doesn't really matter! You'll be albe to apply your Python knowledge to any field of programming you're interested in. Whilst it's not recommended for you to pick only one field and stick to it. It does help to know what path you'd like to persue and the kind of direction you'd like to go so you can tailor your learning to prioritize it.

Sign up to a learning platform and/or get yourself some books

Whilst there are lots of free learning resources out there and you can get a firm grip of the basics, you'll likely get to a point when you need to step your education up a gear. This is where you'll find some paid content will definitely help.

No matter your learning style, you can find high quality resources out there from books to courses and monthly subscriptions, all designed to devle deeper into some more advanced topics and expand your knowledge base.

Most of these courses and book work in a similar way, where you'll be following along and building projects from start to finish, learning as you go whilst your experienced tutor explains what's happening and why. Many online course providers have thriving communities of other learners and tutors who offer support too, making them a great place to start building your knowledge.

What's great is that most of them can be done at your own pace and in your own time, so there's no pressure!

Some popular and recommended paid courses providors:

Some popular books for learning Python include:

Another great way to immerse yourself in learning is by listening to podcasts & audiobooks. Whilst you won't necessarily be learning in a traditional sense, it's a good way to absorb what's happening in the programming ecosystem and pick up some great ideas & knowledge from the host and guests.

Some great podcasts include:

Allocate time to learn and practice

One of the key aspects of efficient learning is creating a regular routine and allocating yourself time to learn.

Time is precious and often at times hard to find. You may have a full time job, a family, other hobbies, be studying or a combination of them all! Allocating days and times for studying and working on programming projects is a great way to get yourself into the flow and will help you out a great deal when it comes to advencing your knowlesge and confidence.

By all means, don't restrict yourself either. If you're in the zone and you feel like things are going in, keep on going. Again, a lot of this comes down to your style of learning and your other commitments.

Learning a programming language takes time, practice, patience and commitment, so committing yourself to a learning schedule will reap the most rewards faster.

Work better in the mornings? Go ahead and schedule some time to code with your morning coffee. More productive at night? Code away into the evening at your own pace. It's all down to your preference so try and pick a time when your brain is firing on all cylinders.

Get involved with the Python community & talk to other developers

Most programming languages have great communities, however Python definitely has one of the most active and friendly communites of them all!

You can get involved by joining groups to talk to other Python developers such as on Slack, Discord or IRC, where you'll find thousands of active members discussing problems, solutions and general conversations around programming and Python.

Stuck with an issue and can't find a solution? Reach out to the community and theres a high chance you'll get some help within minutes. You'll find most of the people in these communities welcome newcomers and enjoy lending a helping line of code or an explenation. The Python community is awesome.

You'll also find local Python programming groups where people get together to work, learn, hack and mess around with code across a wide range of different projects. These local meetups are a great place to develop your skills and meet other developers who will be more than happy to mentor you and help you on your learning journey.

Python also hosts some of the best conferences around the globe. Check out pycon.org to find a conference near you. These conferences are a great place to listen to talks from some of the worlds most renowned developers, learn specifics and ideas at the lightning talks and to meet other programmers, passionate about Python.

You can watch some of the PyCon talks here on the PyCon YouTube channel.

Being part of a programming community will help you immensely on your journey. Feel free to check out and join some of the listed channels below:

Work on your own projects

It's important to learn some of the fundamentals of Python so you've got a solid foundation of knowledge, however it's even more important to put all that new knowledge to use and start working on your own projects!

It's very easy to keep wanting to learn more by following along with your book or course and there's a high chance that you won't feel ready to start working on something yourself. That feeling is natural, however you could spend a lifetime of learning and still not feel like you know enough! Trust me, you're going to learn a lot more by diving into the deep end and learning as you go.

Of course this doesn't mean abandoning your courses or books. Learning Python is a process of both studying and self teaching through trial, error and research.

Once you've got an understanding of working with the basics, it's time to take a break from the courses and books and time to start writing some code. I can't stress how important it is to get stuck in and start writing code of your own, and this is where some new programmers can get stuck as they don't know where to start.

There's 2 main arguments when it comes to working on your own projects. Pick something extremely ambitious or pick something very achievable. I can see arguments for both but would suggest you start by setting your sights on achievable projects that you can get finished. Feeling rewarded at the early stages is extremely important for your morale and finishing a project is just as important too.

You shouldn't be stuck for ideas, but if you are, I'd suggest the following:

  • Build your own personal blog/website

This is a great way to learn some of the fundamentals of Python, databases and the web. It will also introduce you to HTML, CSS and JavaScript. Also, having a personal website is a great place to promote yourself, save code snippets and build online tools for yourself and others.

  • Write some scripts to automate some of your tasks

Python shines when it comes to automating tasks and you'll soon discover how writing tools for yourself can become extremely useful! Automate some tasks such as resizing images in bulk, manipulating spreadsheets, replying to emails, the list is endless!

  • Play around and experiment with some libraries

Seen an interesting package? There's no harm in simply running pip install {package} and experimenting with it! Play around and see how it works, read through the docs and try out some of the features, you might be inspired to build something with it.

  • Build a game

Whilst Python isn't the language for building the latest triple A title games, you can still have a lot of fun and learn a lot by building one. Consider making a text based adventure game or something like tic-tac-toe. Your friends will still be amazed!

Ultimately, whatever you build should be fun/useful or just for the sake of learning something new and if your still stuck, have a chat with some of the people in the Python community, I'm sure they'll be willing to help with some inspiration.

Save your code snippets and write plenty of comments

I cant tell you the amount of times I've gone back to look at code I've written before and it's got me out of trouble.

It really helps to save short snippets of code for future reference and it helps to be able to access them quickly. There are a few applications for this specific purpose so you can download them and play around to see what you like, or just save them in a file locally on your machine.

However, I'd recommend using the Gist feature over at Github, allowing you to create and share short snippets of code which you can access at any time from anywhere (You'll also get some kudos from fellow programmers if they like your Gist!)

If you've never created a Gist before, head on over to github.com and create an account if you don't already have one. Click on the Gist tab in the navigation bar and you're ready to start creating.

Commenting your code is a great way to remind yourself and others of what's happening. Feel free to add plenty of comments to your code but only where it's really required! Remember, you should be able to understand what's happening just by reading the code, using descriptive names for variables, functions and classes goes a very long way. Consider adding docstrings to functions & methods to provide a high level overview of what's happening and use inline comments where you need to be more descriptive.

There's an argument that you shouldn't copy and paste code, to which I agree with... to a certain extent. Simply copying and pasting someone elses code from Stack Overflow or Github isn't recommended but will be very tempting. If it's your own code and you understand what's going on, I'd say it's ok to copy and paste (Although some will argue it's not) As we all know, programmers are lazy and don't like doing things twice!

Copying and pasting random code you don't understand can be dangerous, so make sure you understand what's happening before you do so.

In short. Document your work, create helpful code snippets, use descriptive variable, function and class names, use docstrings and inline comments where required and don't paste arbitrary code from the internet into your own!

Take regular breaks

I haven't got any scientific studies to show you, but it's well known and documented that taking regular breaks is essential for performing at the top of your game. Whilst studies point at different times and frequencies, the consensus is that taking short breaks every 25 - 55 minutes followed by a longer break every few hours is optimal.

There's only so much information your brain can take on in a single session, so make sure you're taking regular breaks, even if it's getting up every 20-30 minutes to get yourself a drink, make a cup of tea or just go for a 4-5 minute walk around your garden.

I've found this method works well, coupled with daily walks outside giving your mind some well earned time to decompress. You'll find inspiration and solutions to your problems when you let your brain relax for just a short period of time.

It might seem counter productive but taking regular breaks actually improves your learning and problem solving ability. Sitting in front of your monitor for hours on end is a quick way to burn yourself out and actually perform worse.

A lot of the reputable course providers will split your learning up into well designed chunks, designed to give you some time to process what you've just learned and help things sink in. If you're working on your own projects, do youself a favour and don't sit there for hours on end otherwise you'll become fatigued and probably start making mistakes.

Programming requires balance, so just remember to help yourself by taking regular breaks.

Improve your workspace

Another point that may not seem obvious at first, but working in a clean, comfortable and well optimized workspace will improve your productivity and increase your performance. This is completely anecdotal, but I've found I can get into a great flow when I'm working in at a clean desk, free of any clutter or distractions.

Go ahead and tidy everything away, break out the feather duster, polish & screen wipes and give your workspace a good and thorough clean down. If possible, make sure you're sat on a comfortable office chair and adjust the lighting so your eyes aren't being strained.

It might sound like I'm talking nonsence but I encourage you to go ahead and give it a try. You might be suprised at the results!

Learn to research & problem solve like a pro

A major skill of any good programmer is learning how to research and find answers for yourself. Before you ask anyone in your community for an answer or explanation, you should leverage the power of search engines and documentation. Most of the answers are out there!

Learning how to ask the right questions or what to search for is a skill that comes with time and practice, however you should try as best as you can until you've exhausted all of the options before reaching out or posting on Stack Overflow, Github or asking someone for help.

Pro tip - People in your community, forums and on sites such as Github and Stack Overflow will quickly become frustrated with you if you keep asking questions without trying to figure it out yourself, expecially if the answer is just a simple search away

Reading documentation can sometimes feel a bit overwhelming and I'll be the first to admin that some libraries, even Python's own documentation can seem confusing and incomplete at times. However, it's important to be able to find out the answers yourself, even if it seems inconvenient and will take longer than just asking someone.

If you're code is throwing an error, you can often find answers simply by posting the Python error into a search engine. Just go ahead and copy/paste the code into Google and you should get some results. Remember, the chances are someone has most likely had the same error as you before! If you just want to understand how something works, go ahead and punch in some keywords into a search engine and I'm sure you'll find what you're looking for.

Ever asked someone for an answer and forgotten it almost immediately? Research and problem solving is a critical skill that comes with time and practice. It will make you a better programmer and the things you learn will stick.

Things to remember

Learning the basics of any programming languages isn't the difficult part, however besoming proficient is. Mastering Python take years of dedication, trial, error and continuous learning and even the most seasoned developers will use search engines, blogs, code snippets and ask their comminuty for help when they need it!

The good news is that you don't need to be a master to create fun, useful and powerful Python code. Just keep at it and slowly things will fall into place.

Python is a great language for newcomers and seasoned developers alike and there couldn't be a better time to learn. Python is on the rise and is (at the time of writing this guide) one of the most talked about programming languages on the planet. With so many learning options and paths you can take, the options are almost endless.

Use some of the tools in this guide to help you on your learning journey and most of all, be patient. Nothing worth learning will happen overnight.

Let me know your your learning tips in the comments below!

Bonus tips


Don't sweat the small stuff

What text editor or IDE you use doesn't matter. It's not going to magically make you a better programmer! Pick one you like of use a combination depending on your preference.

Personal hygiene

Sitting down behind your computer all day and eating meals behind your desk isn't great for your personal hygiene or wellbeing. Break away from the screen for meals and keep youself clean. You'll be surprised at the difference it can make.

Food, drink and exercise

A healthy body is a healthy mind, and a healthy mind is primed for learning. Make sure you're eating a healthy balanced diet with plenty of fruit, vegetables and foods rich in iron, healthy fats and oils, along with plenty of regular exercise, even if it's just a brisk walk around the block.

Hydration is critical, so ditch the sugary sodas and reach for healthy alternatives or even better, just water. Developers are known for their love of caffeine, especially coffee, however you should avoid sugar and excess milk as you'll be sure to crash shortly after.

Living a healthy lifestyle and making better food, drink and exercise choices will benefit you more than you can imagine.

Learn GIT and create a free Github or GitLab account

Git is a powerful version control tool relied upon by developers all over the globe. Github and GitLab are great tools for sharing your code, creating code snippets, hosting your remote repositories and more. Learning GIT and using version control is highly recommended as you progress through your Python learning journey.

Build a rock solid development rig

This is totally optional and you can definitely get by using some pretty basic computer hardware. However, working on a powerful machine definitely makes life easier and makes learning or working on projects even more enjoyable.

The odds are, you'll have multiple tabs open in multiple browsers, numerous editors and IDE's open, services running in the background, databases, containers, terminals & more all running simultaneously. The point I'm making is that most developers need to run multiple programs at the same time to achieve an optimal workflow.

I'd recommend the following (In order of priority):

  • A fast boot drive, either an SSD or NVMe (The bigger capacity the better. Go with at least 500GB)
  • A good quality monitor with a high resolution (27 - 32 inch with a minimum resolution of 2560x1440)
  • As much RAM as possible (At least 16GB but anywhere from 16-64GB is ideal)
  • A multi-core, multi-threaded processor (At the time of writing, I'd recommend any of the AMD Threadripper II family)

For an even better experience, consider a multiple monitor setup coupled with a good quality graphics card for multi-display efficiency!

Get comfortable with Linux

Learning the basics of Linux and getting comfortable working with various distributions is a great skill to have. A large percent of the worlds web servers are running Linux and it's extremely useful to know how to work with it.

Want to spin up your own web server? It helps to know some Linux. Want to automate with scripts with Docker? Linux is your friend! Learning Linux also allows you to get a better understanding of what's going on under the hood, closer to the metal and adds to your developer knowledge base. And it's free!

If you're a Windows user, I'd recommend the Windows Subsystem For Linux or fire up a virtual machine and install a distribution of your choice. I'd recommend Ubuntu 18.04

Be patient & don't give up

Most of all, be patient and don't give up. You'll definitely get frustrated at times and face many challenges along your journey. But after some time you'll face less frustrations and things will just start to make sense, it's almost like developing a sixth sense. Learning Python is like learning any other foreign language, with the benefit that it's in English!

Your feedback

Got some tips for learning Python or have some feedback? Let me know your thoughts in the comments below. I'm sure everyone would love to hear from you!

Last modified · 07 Feb 2019
Did you find this article useful?
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License
Contents
Loading...