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:

  1. Main lesson file (e.g., 2_variables_and_types.py) - Detailed explanations with examples

  2. TODO 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#

  1. Open the main lesson file in your text editor or IDE

  2. Read through the comments - they explain everything!

  3. Run the script to see the output:

    python 1_hello_world.py
    
  4. Stop at TODO markers and complete the exercises

  5. Open the corresponding TODO file for guided practice

  6. Experiment! Change values and see what happens

Best Practices#

  1. โœ… Type every example - Donโ€™t copy-paste, type it yourself

  2. โœ… Run frequently - Execute code often to see results

  3. โœ… Break things - Try invalid inputs to understand errors

  4. โœ… Complete TODOs - Practice is essential

  5. โœ… 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#

  1. Easy Level Notebooks (easy/ directory)

    • Interactive Jupyter notebooks

    • More exercises and visualizations

    • AI/ML introduction

    • Computing fundamentals

  2. Developer Tools Track (tools/ directory)

    • Shell/command line basics

    • Git version control

    • Professional development skills

  3. 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 --version or python3 --version

โ€œFile not foundโ€

  • Make sure youโ€™re in the beginner_scripts/ directory

  • Use cd to 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:

Documentation:

When Stuck:

  • Read error messages carefully

  • Use print() to debug

  • Check the TODO files for hints

  • Search for the error online

  • Ask in r/learnpython or Python Discord


๐ŸŒŸ Tips for Success#

  1. Consistency > Intensity: Practice 30 minutes daily beats 5 hours once a week

  2. Embrace Errors: Theyโ€™re learning opportunities, not failures

  3. Experiment Freely: Modify examples to see what breaks and why

  4. Teach Someone: Explaining concepts solidifies your understanding

  5. 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!