Course Overview
This course is designed to introduce students to the basics of computer programming using Python. It uses the built-in Turtle library to visualize core concepts. The course is divided into several units, each unit consisting of theory, code examples, and a mini project. The final unit concludes with a game that is developed using the material learned throughout the course.
Unit 1: Introduction to Python Programming and the Turtle Library
- Objective: Learn about the Python programming language and how to set up your system to run your first program.
- Topics:
- What is programming?
- Introduction to Python
- Setting up your Python environment and VS Code Editor
- Writing and Running your First Python Program
- Introduction to Turtle Library
- Project: Draw a square using the Turtle library
Unit 2: Variables and Data Types
- Objective: Understand variables and basic data types.
- Topics:
- Python program structure
- Understanding variables
- Data types: strings, integers, floats, and booleans
- Basic operations with strings, integers and floats
- Boolean operations
- Project: Draw a shape based on the number of sides provided by the user.
Unit 3: Arithmetic and Comparison Operators
- Objective: Understand and use arithmetic and comparison operators.
- Topics:
- Arithmetic operators (+, -, *, /, %)
- Comparison operators (>, <, ==, !=)
- Project: Draw different shapes based on user's input using comparison operators.
Unit 4: Control Flow - If Statements
- Objective: Understand and use "if", "else", and "elif" statements to control program flow.
- Topics:
- Understanding control flow
- "if" statements
- "else" and "elif" statements
- Nested "if" statements
- Project: Draw a shape where the color is based on the number of sides (using if statements).
Unit 5: Control Flow - Match-Case Statement
- Objective: Understand and use match-case statement.
- Topics:
- Understanding match-case statements
- Using match-case for multiple conditions
- Case blocks
- Match-case vs if-elif-else
- Project: Draw a shape where the color is based on the number of sides (using match-case).
- Objective: Understand and use "while" and "for" loops to repeat actions.
- Topics:
- Understanding loops
- "while" loops
- "for" loops
- Loop control with "break" and "continue"
- Project: Draw a pattern of shapes using for and while loops.
- Objective: Understand and create functions, function parameters and return values.
- Topics:
- Understanding functions
- Creating and calling functions
- Function parameters and arguments
- Return values
- Project: Draw a pattern of shapes by making use of reusable functions.
- Objective: Understand and create lambda functions.
- Topics:
- Understanding lambda functions
- Creating and using lambda functions
- Differences between normal functions and lambda functions
- Project: Using lambda functions to control the color of shapes.
- Objective: Understand and use keyboard and mouse events with Turtle.
- Topics:
- Understanding events in Turtle
- Binding keyboard keys and mouse events to functions
- Responding to keypress and mouse events
- Creating interactive drawings
- Project: Create a program where the turtle moves in response to mouse clicks and arrow key presses.
Unit 10: Python's Built-in Functions
- Objective: Understand and use Python's built-in functions.
- Topics:
- Introduction to Python's built-in functions
- Commonly used built-in functions (print, input, len, type, etc.)
- Type conversion functions (int, str, float, etc.)
- Project: Use built-in functions to enhance your turtle drawing program.
- Objective: Explore common functions that operate on strings.
- Topics:
- Basic string operations
- String methods (lower, upper, split, etc.)
- Formatting strings
- Concatenation and interpolation
- Project: Word Processing and Analysis.
- Objective: Understand and use lists and list methods to store, access, and manipulate multiple values.
- Topics:
- Understanding lists
- Creating and accessing lists
- Modifying lists
- List methods (append, remove, sort, etc.)
- Project: Use a list to store multiple shapes and have your turtle draw each of them in order.
- Objective: Understand and use list comprehension.
- Topics:
- Understanding list comprehension
- Syntax of list comprehension
- Using conditionals in list comprehension
- Applications of list comprehension
- Project: Use list comprehension to generate a sequence of movements the turtle draws.
- Objective: Understand and use ranges, sets, and tuples.
- Topics:
- Understanding and using ranges
- Understanding and using sets and their methods
- Understanding and using tuples
- Differences between lists, sets, and tuples
- Project: Create a program where a range controls the size of a shape, a set controls the colors, and a tuple controls the position.
- Objective: Understand and use dictionaries.
- Topics:
- Understanding dictionaries
- Creating, accessing, and modifying dictionaries
- Dictionary methods
- Project: Create a Turtle Drawing Program with Command Mapping
- Objective: Learn how to handle files in Python, including reading and writing data to files in CSV format.
- Topics:
- Understanding file operations: read, write, append
- Using Python's built-in 'open' function for file operations
- Reading data from a file
- Writing data to a file
- Understanding CSV files and why they are important
- Reading CSV files using built-in Python capabilities
- Writing data to a CSV file
- Project: Create a Turtle Program with Save and Restore Functionality
Unit 17: Object-Oriented Programming - Intro
- Objective: Understand the basics of Object-Oriented Programming (OOP).
- Topics:
- Introduction to OOP
- Understanding classes and objects
- Creating classes and objects in Python
- Instance variables and methods
- Project: Create a simple Shape class to represent the shapes the turtle draws.
Unit 18: Object-Oriented Programming - Methods and Variables
- Objective: Understand and use methods in classes.
- Topics:
- Understanding methods
- The
__init__
method - Instance methods
- Class variables vs instance variables
- Project: Add methods to your Shape class to calculate perimeter, area, and draw the shape using Turtle.
Unit 19: Object-Oriented Programming - Inheritance
- Objective: Understand and use inheritance in classes.
- Topics:
- Understanding inheritance
- Creating subclasses
- Overriding methods
- The
super()
function
- Project: Create subclasses of the Shape class that represent specific shapes and draw them using Turtle.
Unit 20: Object-Oriented Programming - Encapsulation and Polymorphism
- Objective: Understand and use encapsulation and polymorphism.
- Topics:
- Understanding encapsulation and abstraction
- Understanding polymorphism
- Private and protected access modifiers
- Project: Refactor the Shape class to use private variables and accessor methods.
- Objective: Understand and use recursion in Python.
- Topics:
- Understanding recursion
- Base case and recursive case
- Examples of recursion
- Recursion vs iteration
- Project: Draw a fractal using recursion and the Turtle library.
Unit 22: Modules, Packages and Libraries
- Objective: Learn how to split a Python program into multiple files, modules, and libraries.
- Topics:
- Understanding modules, packages and libraries
- Creating and using modules
- Creating and using packages
- Importing external packages and libraries
- Project: Split your turtle drawing code into separate modules and import them to create a cohesive drawing.
Unit 23: Python Standard Library
- Objective: Explore some of the most commonly used modules in the Python Standard Library.
- Topics:
- Introduction to the Python Standard Library
- Overview of some common modules (math, random, datetime, os, json, io, re, etc.)
- Combining modules to create complex programs
- Project: Enhance your turtle drawing program using functions from the Python Standard Library.
- Objective: Learn how to interact with web services using APIs.
- Topics:
- Understanding APIs
- Making API Requests
- Requests Library
- JSON Data Format
- Project: Fetch and display a random quote using turtle.
Unit 25: Debugging and Error Handling
- Objective: Understand the basics of debugging and error handling.
- Topics:
- Introduction to debugging and errors in Python
- Basic debugging techniques
- Common errors and exceptions
- Raising exceptions
- Custom exceptions
- Error handling with try, except, else, finally
- Project: Add error checking to your turtle program to handle different types of exceptions.
- Objective: Learn how to write tests for your Python code.
- Topics:
- Introduction to testing
- Writing unit tests with
pytest
- Running tests and interpreting results
- Project: Create a turtle drawing program and write tests for it.
Unit 27: Managing Code with Git and GitHub
- Objective: Learn how to manage and collaborate on code projects using Git and GitHub. Understand how to create repositories, commit changes, push code to GitHub, and work with branches.
- Topics:
- Introduction to Version Control Systems
- Setting Up Git
- Creating a Local Repository
- Connecting to GitHub
- Pushing Code to GitHub
- Working with Branches
- Collaborating with Others
- Best Practices and Common Git Commands
- Project: Create a project for your Turtle program, manage it using Git and push it to a GitHub repository. Collaborate with a partner (if possible) to simulate a real-world collaboration workflow.
Unit 28: Managing Projects with Poetry
- Objective: Learn how to manage Python projects, dependencies, and virtual environments using Poetry. Understand how to create a project, add dependencies, and build and publish packages.
- Topics:
- Introduction to Dependency Management
- Installing and Configuring Poetry
- Creating a New Project with Poetry
- Semantic Versioning
- Working with Virtual Environments
- Poetry Best Practices
- Project: Create a poetry project to fetch and display a random quote using turtle
Unit 29: Game Development Fundamentals
- Objective: Learn the foundational concepts of game development and advanced graphics using Turtle.
- Topics:
- Introduction to Game Development with Turtle
- Creating and Controlling Multiple Turtle Instances
- Handling User Input
- Building Game Loops
- Managing Game State
- Designing Game Levels and Obstacles
- Implementing Collision Detection
- Enhancing Visuals and User Experience
- Best Practices in Game Development
- Project: Create a "Collect the Stars" game
Unit 30: Building the Game "Snake"
- Objective: Create the game "Snake" by incorporating all the lessons learned.
- Topics:
- Game design and planning
- Game development
- Testing and debugging the game
- Project: Create a complete, functional version of the game "Snake".