Python Exercises for Beginners¶
Here you find exercises for people new to Python. I wrote them for teachers looking for material and people learning Python by themselves.
The goal of the exercises is to enable you to write Python programs up to 200 lines. The exercises cover six areas:
area |
description |
---|---|
🚀 applications |
programs that do fun stuff |
💡 functions and data types |
useful Python objects |
⚙ syntax |
grammar rules and keywords |
🔀 patterns |
useful expressions and idioms |
🔧 tools |
things that make programming easier |
🐞 debugging |
discover and fix broken code |
First Steps¶
Coding Challenges¶
Reference¶
Examples of common Python commands
- The IPython Shell
- Running Code from a Terminal
- Python Programs
- Data Types in Python
- Numbers
- Strings
- Tuples
- Lists
- Dictionaries
- Type conversions
- Indexing and Slicing
- Writing to the Screen
- String formatting
- Reading text from the keyboard
- Reading text files
- Writing text files
- Working with directories
- Conditional statements with
if
- Loops with for
- Conditional loops with while
- Builtin functions
- Functions