Python 3 Tutorial

This is a tutorial suitable for high school students, covering the content in ICS3U (Ontario).It’s currently in the process of being rewritten. The “new” tutorial uses a more spiralled approach, revisiting key concepts in each “unit”, whereas the “old” tutorial uses a more traditional, concept-separated approach. At some point, lessons from the old tutorial will be restructured to fit the order of the new tutorial. For now, both versions are accessible.

There is also a section for Frequently Asked Questions. If you’ve got a question that can’t be answered by reading one of the relevant sections below, send me an email and I may add it to the list.

The New Tutorial (Handouts Only)

  1. Python Basics
    1. Basic Mathematics In Python
    2. More Mathematics In Python
    3. Input/Output and Random Numbers
    4. Data Types and Variables
    5. Python Basics Review
    6. RPG Stage 1: Character Creation
  2. Program Flow, Part 1
    1. Making Decisions Using If Statements
    2. Counted Repetition Using For Loops
    3. Terminating For Loops Early
    4. Tuples and Random Choices
    5. Program Flow 1 Review
    6. Practice Project: Simple Math Game | Sample Code
    7. RPG Stage 2: Random Enemies
  3. Program Flow, Part 2
    1. Nested If Statements
    2. Logical Operators
    3. Tuple Packing and Unpacking
    4. Conditional Repetition Using While Loops
    5. Simple Input Validation
    6. Program Flow 2 Review
    7. Practice Project: Automated Teller Machine
    8. RPG Stage 3: Simple Battle
  4. Algorithms and Documentation
    1. TBD
  5. Program Structure
    1. Nested Loops
    2. Creating Functions
    3. Functions Returning Values
    4. Functions Calling Other Functions
    5. Better Input Validation
    6. Creating Modules
    7. Practice Project: Pie Fight
    8. Practice Project: Fractions
    9. RPG Stage 4: Advanced Battle | RPG Functions
  6. Sequence Data Types
    1. String and List Basics
    2. String Methods
    3. Adding and Removing List Elements
    4. Searching and Sorting
    5. Advanced Input Validation
    6. Formatting Strings

The Old Tutorial (Still Relevant, but Differently Ordered)

  1. Getting Started with Python
    1. Installing and Starting Python
    2. Basic Mathematics
    3. Advanced Mathematics
    4. Variables and Data Types
    5. Simple Input and Output
  2. Conditional Processing
    1. Making Decisions Using ‘if’
    2. Alternate Decisions Using ‘elif’ and ‘else’
    3. Nested Ifs
    4. Logical Operators: ‘and’, ‘or’ and ‘not’
    5. Generating Random Numbers
    6. Basic Input Validation and Error Prevention
    7. More Programs Involving Conditional Processing
  3. Code Repetition
    1. Counted Repetition with ‘for’ Loops
    2. Problem Solving with ‘for’ Loops
    3. Terminating For Loops Early
    4. Conditional Repetition with ‘while’ Loops
    5. Problem Solving with ‘while’ Loops
    6. Nested Loops
    7. Input Validation Using Loops
    8. Cumulative Task: The Game of Nim
  4. Algorithm Design & Documentation
    1. Algorithms
    2. Pseudocode
    3. Flowcharts
    4. Comments and Inline Documentation
    5. Trace Tables
    6. Using a Debugger
    7. Cumulative Task: TBD
  5. String Processing
    1. String Basics
    2. General Info About Strings
    3. Working With Substrings
    4. Slicing Strings
    5. Basic String Formatting
    6. Advanced String Formatting
    7. Practice Project: Hangman | Sample Code
  6. Tuples, Lists and Dictionaries
    1. Tuples
    2. List Basics
    3. Adding and Removing List Elements
    4. Splitting/Joining Strings and List Comprehensions
    5. Searching and Sorting Lists
    6. Multi-Dimensional Lists
    7. Dictionaries
    8. Cumulative Task: TBD
  7. Creating Functions
    1. Creating Simple Functions
    2. Functions That Return a Value
    3. Functions Returning Multiple Values
    4. Optional Arguments and Default Values
    5. Variable Scope
    6. Functions That Call Other Functions
    7. Cumulative Task: TBD