Exercises for Real Python's "Python Basics: A Practical Introduction to Python 3" Book
If you have git
installed, the easiest way to access these files is to clone the repository to the directory of your choice:
$ git clone https://github.com/realpython/python-basics-exercises.git
Alternatively, you can download the entire repository as a .zip
file from the repository's homepage using the green "Clone or download" button in the top right hand corner, or by clicking here.
To run the code examples, first make sure you have Python 3 installed on your machine. If you need help installing Python 3, check out our Python 3 Installation & Setup Guide.
Example: To run the 3-store-a-variable.py
exercise, type python3 3-store-a-variable.py
into your terminal. Here's how that looks, with output:
$ python3 ch03-first-python-program/3-store-a-variable.py
hello
hi
Note: Depending on your installation, you may need to type
python3.7
orpython37
to run the examples.