Beginner Python Scripts - Your First Steps#
Start here if youโre a complete beginner! These Python scripts provide the gentlest introduction to programming before diving into the full Education Playground curriculum.
๐ About This Track#
This is the absolute beginner track - simple .py scripts with extensive comments and guided exercises. Perfect for:
Complete programming beginners
Students who prefer scripts over Jupyter notebooks
Classroom instruction (includes timing and instructor notes)
Quick reference and practice
๐ฏ Who Should Use This?#
Choose this track if you:
Have NEVER programmed before
Want step-by-step guided lessons
Prefer running Python scripts (not notebooks)
Are teaching a beginner class
After completing this, progress to:
Easy Level in main Education Playground for interactive notebooks
Developer Tools track for professional skills
Medium Level if you grasp concepts quickly
๐ Lesson Structure#
Each lesson has two files:
Main lesson file (e.g.,
2_variables_and_types.py) - Detailed explanations with examplesTODO exercise file (e.g.,
2_variables_and_typestodo.py) - Hands-on practice
Format Features#
โฑ๏ธ Time Estimates: Each section shows expected duration
๐ TODO Markers: Stop and practice at designated points
๐ Section Titles: Clear topic headers
๐ก TAKEAWAY Sections: Key concept summaries
โ ๏ธ FIXME Comments: Common mistakes to learn from
๐ Complete Lesson Plan#
Lesson 1: Hello World#
File: 1_hello_world.py
Time: 5 minutes
Topics:
Your first Python program
Running Python code
The print() function
Lesson 2: Variables and Types#
Files: 2_variables_and_types.py + 2_variables_and_typestodo.py
Time: 20 minutes
Topics:
Creating variables
Data types (int, float, string, boolean, None)
Multiple variable assignment
Type checking with
type()Type conversions (str(), int(), float(), bool())
String concatenation
Key Concepts:
Variables as โpointersโ to values
Case sensitivity in Python
Difference between concatenation (+) and comma separation
Lesson 3: String Manipulation#
Files: 3_string_manipulation.py + 3_string_manipulationtodo.py
Time: 15 minutes
Topics:
String indexing
String slicing
String methods (upper(), lower(), replace(), split(), strip())
Escape characters
Multi-line strings
Key Concepts:
Strings are sequences (can be indexed)
Positive and negative indexing
Slicing syntax [start:end:step]
Lesson 4: Basic Math#
Files: 4_basic_math.py + 4_basic_mathtodo.py
Time: 20 minutes
Topics:
Arithmetic operators (+, -, *, /, //, %, **)
Order of operations
Math with variables
Comparison operators (==, !=, <, >, <=, >=)
The math module
Key Concepts:
Integer division vs float division
Modulo operator for remainders
Exponentiation with **
Lesson 5: Lists and Dictionaries#
Files: 5_lists_and_dicts.py + 5_lists_and_dictstodo.py
Time: 30 minutes
Topics:
Creating lists
List indexing (positive and negative)
Appending to lists
Modifying list elements
Creating dictionaries
Accessing dictionary values by key
Adding key-value pairs
Nested lists and dictionaries
Tuples (immutable lists)
Key Concepts:
Lists are ordered and mutable
Dictionaries map keys to values
Tuples are immutable
Complex data structures with nesting
Lesson 6: List and Dictionary Methods#
Files: 6_lists_and_dicts_methods.py + 6_lists_and_dicts_methodstodo.py
Time: 25 minutes
Topics:
List methods: append(), insert(), remove(), pop(), sort(), reverse()
Dictionary methods: keys(), values(), items(), get(), pop()
List comprehensions (basic)
Dictionary comprehensions (basic)
Key Concepts:
Methods modify the original structure
Methods vs functions
Comprehensions for concise code
Lesson 7: Imports#
Files: 7_imports.py + 7_importstodo.py
Time: 15 minutes
Topics:
What are modules?
Importing entire modules
Importing specific functions
Using aliases (import โฆ as)
Common built-in modules (random, datetime, math)
Key Concepts:
Code reusability through modules
Python Standard Library
Third-party packages
Lesson 8: Error Handling#
Files: 8_error_handling.py + 8_error_handlingtodo.py
Time: 15 minutes
Topics:
Types of errors (SyntaxError, TypeError, ValueError, etc.)
Reading error messages
Try-except blocks
Catching specific exceptions
Finally blocks
Key Concepts:
Errors are normal and expected
Graceful error handling
Debugging strategies
Lesson 9: Indexing and For Loops#
Files: 9_indexing_and_for_loops.py + 9_indexing_and_for_loopstodo.py
Time: 25 minutes
Topics:
For loops basics
Iterating over lists
Iterating over dictionaries
Range() function
Enumerate() function
Nested loops
Key Concepts:
Iteration pattern
Loop variable
Range for counting
Enumerate for index+value
Lesson 10: Conditionals and While Loops#
Files: 10_conditionals_and_while_loops.py + 10_conditionals_and_while_loopstodo.py
Time: 30 minutes
Topics:
If statements
If-elif-else chains
Logical operators (and, or, not)
While loops
Break and continue statements
Infinite loop prevention
Key Concepts:
Boolean logic
Control flow
Loop control (break/continue)
When to use for vs while
๐ How to Use These Lessons#
Running the Code#
Open the main lesson file in your text editor or IDE
Read through the comments - they explain everything!
Run the script to see the output:
python 1_hello_world.pyStop at TODO markers and complete the exercises
Open the corresponding TODO file for guided practice
Experiment! Change values and see what happens
Best Practices#
โ Type every example - Donโt copy-paste, type it yourself
โ Run frequently - Execute code often to see results
โ Break things - Try invalid inputs to understand errors
โ Complete TODOs - Practice is essential
โ Review - Go back to previous lessons as needed
For Instructors#
Each lesson includes:
Time estimates for pacing
FIXME sections to demonstrate common errors
TODO breaks for student practice
TAKEAWAY summaries for concept reinforcement
Suggested Pace: 2-3 lessons per session (1-2 hours)
๐ฏ After Completing This Track#
Once youโve mastered these fundamentals, youโre ready for:
Next Steps in Education Playground#
Easy Level Notebooks (
easy/directory)Interactive Jupyter notebooks
More exercises and visualizations
AI/ML introduction
Computing fundamentals
Developer Tools Track (
tools/directory)Shell/command line basics
Git version control
Professional development skills
Take the Calibration Test (
00_calibration_test.ipynb)Assess your skills
Get personalized level recommendation
Track your progress
Skills Youโll Have#
After completing all 10 lessons, youโll be able to:
โ Write and run Python programs
โ Use variables, loops, and conditionals
โ Work with lists, dictionaries, and strings
โ Handle errors gracefully
โ Import and use modules
โ Read and understand Python code
โ Debug basic problems
๐ง Troubleshooting#
โPython command not foundโ
Install Python 3.10+ from python.org
Verify:
python --versionorpython3 --version
โFile not foundโ
Make sure youโre in the
beginner_scripts/directoryUse
cdto navigate:cd beginner_scripts
โSyntax Errorโ
Check for typos, missing colons, incorrect indentation
Read the error message - it tells you the line number!
โImport Errorโ
Built-in modules (random, math, datetime) should work automatically
For third-party modules, use:
pip install module_name
๐ Additional Resources#
Practice Platforms:
Futurecoder - Interactive Python for absolute beginners
Python Tutor - Visualize code execution
LearnPython.org - Interactive tutorials
Documentation:
Python Cheatsheet - Quick reference guide
When Stuck:
Read error messages carefully
Use
print()to debugCheck the TODO files for hints
Search for the error online
Ask in r/learnpython or Python Discord
๐ Tips for Success#
Consistency > Intensity: Practice 30 minutes daily beats 5 hours once a week
Embrace Errors: Theyโre learning opportunities, not failures
Experiment Freely: Modify examples to see what breaks and why
Teach Someone: Explaining concepts solidifies your understanding
Build Something: Apply what you learn to a small project
Ready to start? Open 1_hello_world.py and begin your programming journey! ๐
Questions or feedback? Open an issue on GitHub or join the discussion!