X Tutup
The Wayback Machine - https://web.archive.org/web/20200402085702/https://github.com/realpython/python-basics-exercises
Skip to content
Python Basics: A Practical Introduction to Python 3
Python
Branch: master
Clone or download

Latest commit

Latest commit 62653b8 Apr 2, 2020

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
ch03-first-python-program Cleanup Dec 4, 2018
ch04-strings-and-string-methods Fix typo Apr 1, 2020
ch05-numbers-in-python Remove underscores and fix chapter section numbering Nov 15, 2019
ch06-functions-and-loops Add docstring Feb 19, 2020
ch08-conditional-logic Remove extra coin flip and clean up challenge solution Feb 19, 2020
ch09-lists-tuples-and-dictionaries Add solution to new list comprehension exercise Feb 4, 2020
ch10-primer-on-oop Add blank line Feb 19, 2020
ch11-modules-and-packages Add solutions to section 2 exercises Feb 11, 2020
ch12-file-input-and-output Increase chapter numbers by 1 to make room for new Modules and Packag… Feb 11, 2020
ch14-interact-with-pdf-files Increase chapter numbers by 1 to make room for new Modules and Packag… Feb 11, 2020
ch15-sql-database-connections
ch16-interacting-with-the-web Increase chapter numbers by 1 to make room for new Modules and Packag… Feb 11, 2020
ch17-scientific-computing-and-graphing Increase chapter numbers by 1 to make room for new Modules and Packag… Feb 11, 2020
ch18-graphical-user-interfaces Increase chapter numbers by 1 to make room for new Modules and Packag… Feb 11, 2020
.flake8 Update black and flake8 config Dec 7, 2018
.gitignore Refactor exercises naming scheme (ch06-ch17) Aug 27, 2018
README.md Update README.md Feb 3, 2019
pyproject.toml Update black and flake8 config Dec 7, 2018

README.md

Exercise Solutions for Real Python's "Python Basics: A Practical Introduction to Python 3" Book

In this code repository you find the solutions and sample implementations for the solutions and challenges posed in our Python Basics book. All solutions and sample files are ordered by chapter so you can quickly navigate to the code you're looking for.

Get the Book

» Click here to learn more about the book and get your copy

Downloading the Files

With git

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

Without 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.

Running the Solutions & Code Examples

To run the solution code and 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 or python37 to run the examples.

You can’t perform that action at this time.
X Tutup