How I Learned the Basics of Python in 2 Weeks

Photo by Chris Ried on Unsplash

How I Learned the Basics of Python in 2 Weeks

I had a brief encounter with Python when I went through General Assembly’s full stack Bootcamp back in 2020. However, I haven’t been using Python all that much since. I wanted to refresh myself on it so that I could better understand it’s implementation in test automation as well as machine learning.

Python has a wide range of uses including AI and machine learning, data analytics, web development, game development, finance, task automation and so much more. With that in mind, I was curious how I could go from a tiny bit of knowledge to at least understanding the fundamentals of the language. Below you’ll find a guide to some very useful tutorials and reading that helped me understand how I could begin to use Python.

Mosh

Programming with Mosh is a great YouTube channel to learn the fundamentals of many different languages and frameworks. He also has more intermediate videos once you're more comfortable. Mosh's video Python in 1 Hour is a great intro to many of the fundamentals you'll find and use in Python. The tutorial covers the most basic of how you get Python on your machine, all the way up to the more complex ideas like what you can do with tuples.

This video is great for someone who is looking to start from scratch. Mosh will show you how to download Python and PyCharm on to your machine. PyCharm is an IDE for Python. An IDE is an Integrated Development Environment. It's beneficial because it has the ability to edit source code, debug, and build executables all in one. IDEs also autocomplete which is really helpful when you're just starting out.

After getting the language and the right IDE downloaded, Mosh dives into using variables, strings, primitive data types, complex data types and arithmetic operators. Mosh shows you some simple string manipulation as well. Once he gets you comfortable with these, you build a simple calculator together that makes use of all those ideas in Python. The best way to learn any language is to dive into creating projects, so it's incredibly helpful to immediately build a project after learning these fundamental principles.

After getting comfortable with the basics, Mosh moves onto a bit more complex ideas like if statements, lists, the range() method, for loops, while loops, and tuples. These concepts are crucial to leveling up your coding skills in Python since they're widely used by developers to build out their code base. I think this video tutorial is a great place to start.

freeCodeCamp

Although many of the concepts covered in Mosh's video are also covered in this freeCodeCamp Python tutorial, I think that the repetition helps cement the concepts in your mind and get a deeper understanding of how to use them. Python in 4 hours goes a bit more in depth into the same principles and concepts that Mosh went into, but more in depth with more projects to practice your skills on.

Similar to Mosh, it will walk you through how to download Python and PyCharm on to your machine. After that, you will learn variables and data types and how to print them to the console. You'll also learn a bit about string concatenation. You'll get more comfortable with working with numbers, too, as well as explore some more built in functions that can help you manipulate your data.

One aspect of this tutorial that is incredibly helpful is the fact that it goes over how to get input from users. By learning this and having the knowledge of primitive data types, you'll be able to create a better calculator as well as a fun mad libs game!

Like the Mosh video, this one goes over lists, but goes more in depth with list functions like how to print them, how to add stuff to them, how to sort them, and many other handy tricks. There's a brief section about tuples as well, just as a nice refresher.

Functions and return statements are definitely crucial principles to understand in Python. This video does an excellent job of helping you understand how to use them. In relation to that, the video goes into if statements, comparisons, and how to use them within the context of a function. You'll use this knowledge, in addition to learning about dictionaries and while loops, to create a guessing game.

This tutorial also does a deeper dive into for loops and adds to your knowledge base with more information about 2d lists and nested loops, adding comments to code, try / except blocks, and manipulating text files. One big differentiation between Mosh's video from this one is the deep dive into classes and objects. These are some fundamental concepts that are necessary to boosting your coding skills in Python. He also goes over inheritance and how that works with classes.

I think overall, if you were to watch just one of these beginner tutorial videos, I would recommend the freeCodeCamp one. It goes more in depth on the concepts and also covers more topics that are crucial to understand in Python.

freeCodeCamp Project

Like I mentioned earlier, building projects is the best way to learn a new language or framework. Fortunately, as always, freeCodeCamp comes in clutch with a video tutorial on how to build 12 different projects in Python. The video goes over building:

  • Madlibs
  • Guess the number (computer)
  • Guess the number (user)
  • Rock paper scissors
  • Hangman
  • Tic-Tac-Toe
  • Tic-Tac-Toe AI
  • Binary Search
  • Minesweeper
  • Sodoku Solver
  • Photo Processing
  • Markov Chain Composer

Conclusion

The combination between Mosh's video and freeCodeCamps videos is a great way to jump start your Python learning. Since the videos are relatively short, I was able to cram about 30 minutes to an hour in every night so that I was able to rip through these in just 2 weeks. I was working full time while going through it, so if you're still job hunting and looking for a skill boost, you could likely knock these out in just a few days. With Python's growing popularity and the types of tech it can be applied to, Python is a great language to have in your back pocket.