Lesson 1: Installation and Introduction
Hello and welcome to my free Python course. Python is a very simple programming language and personally the first one I ever learned. I believe it's one of the best first steps into the world of programming.
In this course, you only need to get a workspace where you will code. I will be using JetBrains PyCharm, so I recommend using the same program (the download link is located below), but if you like working in Visual Studio Code, that’s absolutely okay as well.
In PyCharm, you don’t have to do much—it will automatically set up the environment; in VS Code, you just need to download the Python extension.
Why learn Python?
Python is easy to read, forgiving to beginners and used almost everywhere: websites, automation, data analysis, games and artificial intelligence. Its code looks close to plain English, so you spend your time learning how to think like a programmer instead of fighting with strange symbols.
What you will learn
This course takes you from zero to your first real programs, one small step at a time:
- printing text and asking the user for input
- variables, data types and math operators
- making decisions with
if,elifandelse - repeating code with
whileandforloops - storing data in lists and lists of lists
- writing your own functions
- classes and objects, finishing with a small project
How the course works
Every lesson is short (usually 5 to 10 minutes) and covers one idea with examples you can copy and run. The practice lessons contain exercises with hidden answers, so try to solve each one yourself first and only then reveal the solution. If you play the lessons in the CodeStart game, you also earn XP and level up as you go.
Step 1: Install Python
Go to the official Python download page, download the latest version for your system (Windows, macOS or Linux) and run the installer. On Windows, tick the box Add python.exe to PATH on the first screen of the installer. It saves you from a very common problem later.
Step 2: Install an editor
An editor is the program where you write and run your code. You only need one, so do not spend too long choosing:
- PyCharm is made specifically for Python and sets up the environment for you. This is what the course uses.
- Visual Studio Code is a lighter alternative. After installing it, add the free Python extension.
Step 3: Check that it works
Create a new file called hello.py, type the line below and run the file (in PyCharm right-click and choose Run, in VS Code press the play button).
If you see Hello, world! in the output, everything is set up and you are ready for the next lesson.
If something goes wrong
- "python is not recognized" on Windows: reinstall Python with the PATH box ticked, then restart your terminal or computer.
- On macOS and Linux the command is often
python3instead ofpython. - Nothing happens: make sure the file is saved with the
.pyending and that you are running the right file.
Tips for learning faster
Type the code yourself instead of only reading it, do the exercises, and study a little every day rather than a lot once a week. Errors are not a sign that you are bad at this. Every programmer sees them all the time, and reading the error message is part of the skill you are building.
Want XP, levels and progress tracking? Play this lesson in the CodeStart game.
Play Lesson 1