Class 1 – Introduction
Class Material and Notes
Independent Activity
Get your Replit account up and running
Get familiar with the recent REPLIT changes (since Aug 2024)
Revise the Level 1 and Level 2 Projects
Important Info Related to REPLIT platform changes (since Aug 2024)
Single REPL to create multiple projects.
Understanding and Managing REPLIT Development Minutes.
Suggestions for students who created accounts before Aug 2024
Uploading .py files to REPLs
REPLIT platform changes (since Sep 2025)
How to create Python projects on REPLIT
VS Code with Python Extension for Projects
How can I use VSCode with Python Extension?
Class 2 – Laptop Store
Class Videos
- Introduction and Learning Objectives
- Dictionaries – A first introduction
- Accessing dictionary values — get method
- Important Points about dictionary keys
- Creating a dictionary from a list of keys
- A pictorial overview of the data structures and logic for creating the store inventory
- Creating and populating the master dictionary
- Creating and populating the master dictionary (Alternative Implementation)
- Code to create the store’s inventory
- Getting User’s preference and capturing it in a dictionary
- Generating the QUERY from the user’s preferences
- Applying the Query in the NO PREFERENCE case using List Comprehension
- List Comprehension to Apply the Query when user has indicated some preferences
- Displaying the Laptops that Meet the User’s preferences
- Reflection and Looking Back at the data structures used in the project
- A general discussion on Lists and Dictionaries and their usages.
Enhancement Ideas/Videos
Improvements to the Inventory
1. Brand Model Mapping
2. Pricing Based on Specifications
Improvements to the User Interface
1. Showing Options while indicating Laptop preferences
2. A cleaner and more efficient user interface
3. Allowing multiple comma-separated preferences
4. Allowing a range of values in preferences
Improvements to the final display
1. Displaying Selected Laptops in a SORTED manner
2. Displaying different brands in different colors
Class Material and Notes
Class Notes , Class Project (Replit),
Class Project (.py)
- Introduction to Dictionaries
- Basic Dictionary Commands
- Using Dictionaries in code
- Lists vs Dictionaries
- map statement
Class 3 – Top Trumps Game
Class Videos
- Introduction and Learning Objectives
- An introduction to Comma Separated Values (.CSV) files
- CSV.dictreader() method to convert the .csv file to a list of dictionaries
- List slicing and keys() method to extract the relevant keys
- A high level overview of the gameplay logic
- Setting up the gameplay with a while loop
- A function to format and display the keys and values of player card dictionary
- A mapping dictionary to facilitate the user interface
- Using the mapping dictionary to get the key of interest from the player/computer
- A flexible function to determine the winner of every move
- A closer look at the default argument in a function and its usage
- Calling the determine winner function as part of the game loop
- Redistribute the cards to the player/computer/table at the end of a move
- Getting the game to be over and discussion of enhancement ideas
Class Material and Notes
Class Notes
Class Project, Class Project (.py)
Skyscrapers.csv
Key Learning Objectives
- Further exploration and practice with dictionaries.
- Reading data from external files
Bonus Videos
Training Mode
- Showing the BEST card for EVERY category as part of the Training Phase
- TOP FEW cards of EVERY category in table form in the Training Phase
- Showing the statistics of EVERY category in the Training Phase
Robust Game Play – Making the game play more robust
Ranking Cards
- Determining a card’s rank in a given category
- Determining a card’s strength (strong, moderate, weak) based on all its ranks
- Number of strong/moderate/weak cards in a card deck
Making Computer Smart – Making the Computer Smart
Enhanced Gameplay – Gameplay with more cards exchanged in every move
Independent Activity
Class 4 – Welcome Message
Class Videos
- Introduction and Learning Objectives
- A bird’s eye view of the code flow
- Using *args to allow multiple arguments into a function
- Using the tuple called args inside a function to result in a flexible implementation
- What are tuples? Similarities and Differences with Lists
- Using try/except in the short code function to catch non-string arguments
- What are Syntax, Logic and Runtime errors in Python?
- Common Python exceptions and handling TypeError in our function
- Adding an index argument to our short form function
- The general form of try/except: try/except/else/finally, with example
- What are **kwargs? (Keyword Arguments)
- Creating a name_strength function that accepts keyword arguments
- Handling Key Error in the name strength function
- Using *args and **kwargs in the same function
- An overview of the use of **kwargs in the Validate function
- What is assert statement and what causes AssertionError?
- Using try/except/else and assert statements to develop the validate function
- Deep Validate function — Raising Errors with the RAISE statement
- Calling Deep Validate from the validate function using try/except/else/finally
Class Material and Notes
Key Learning Objectives
- *args and **kwargs arguments
- An introduction to tuples
- Handling and Raising Exceptions Across functions
Class 5 – Fractals and Recursion
Class Videos
- Introduction and Learning Objectives
- Creating our first recursive function call
- Analysis of how the recursive function to draw squares works
- Reversing the order of drawing and recursive calls when drawing squares
- Two more examples for recursion: Countdown and Sum of Numbers
- Some variations for the recursive squares function to get new patterns
- The magic created by 2 or 3 recursive calls in the squares function
- How do the two successive recursive calls create an intricate pattern?
- An introduction to the tree fractal pattern
- Analysis of the Tree Pattern and its similarity to the Squares pattern
- Recursion to draw the right side branch of the tree pattern
- Re-aligning and bringing the turtle back to draw the left branch
- Code for drawing the complete tree with two recursive calls
- Generating Fibonacci Numbers with two recursive calls
Bonus Videos
Enhancements to the Square Fractal Pattern
- Creating Levels in square pattern
- Different levels in different colours
- Placing the squares in a step formation
- A tilt for all the squares in the square fractal
Dancing Animation – A dancing animation in the square pattern fractal
Colorful and Realistic Trees
Tree in the wind animation
Special Tree Patterns
Independent Activity
Create a project in Python Turtle which draws a fractal using recursion.
Class Material and Notes
Key Learning Objectives
- Recursion — Functions that call themselves
- An understanding of fractals
Class 6 – Midterm Revision and Quiz.
Class Material (Live Quiz)
Key Learning Objectives
- Revise the concepts covered so far with an interactive quiz.
- Provide students a chance to consolidate their learning and build an independent project of their choice.
Class 7 – Sports Heroes
Class Videos
- Introduction and Learning Objectives
- Preparing CSV data for Wimbledon and French Open winners
- Using CSV module to convert the data into a list of dictionaries
- Open Analysis.dat for writing the analysis results (mode = ‘w’)
- Getting a list of winners and the set of unique winners using the SET() command
- What are sets? How do we create them? What are their important properties?
- Comparing Lists/Tuples/Dictionaries and Sets in Python
- Writing a line of analysis in the analysis.dat file (mode = ‘a’)
- Extracting player info for every winner to a list of dictionary
- A function to write a table of data into the analysis.dat file
- Creating a subset — Players who have won the Wimbledon more than once
- Converting the analysis code to a function so that we can reuse it easily
- Introducing comparative analysis using Wimbledon and French Open datasets
- A function to write values from a set to our analysis.dat file (mode = ‘a’)
- Union of sets to find players who have won EITHER Wimbledon OR French Open
- Intersection of sets to find players who have won BOTH Wimbledon And French Open
- Difference to find players who have Wimbledon but not French Open or vice-versa
- Symmetric Difference for players who have won Wimbledon or French Open, not both
- Wrapping up with an important formula from SET theory in mathematics and bonus ideas
Class Material & Notes
Class Notes, Class Project
Wimbledon.csv
FrenchOpen.csv
Key Learning Objectives
- Introduction to sets
- Uses of set operations
Bonus Videos
Independent Activity
Write a Python program that demonstrates the uses of set functions to do analysis of data.
Class 8 – Bit by Bit
Class Videos
- Introduction and Learning Objectives
- Counting with Binary Numbers
- Converting between Decimal and Binary Numbers
- A big picture view of bitwise operators
- Three basic SINGLE bit operators: OR/AND/XOR
- Bitwise AND
- Bitwise OR
- Bitwise XOR
- Compare and contrast bitwise AND/OR/XOR with other operators
- Some interesting special cases — AND/OR/XOR with all 1s and all 0s
- Bitwise RIGHT shift operators
- Bitwise LEFT shift operators
- Using Pixels of an image to visualise the bitwise operators
- A description of the Activity that we will perform
- Setting up the LED matrix emulation using Python Turtle
- Lighting up the LEDs based on the binary representation of the pattern
- Setting up an outer loop to create dynamic patterns
- Dynamic LED Pattern Using LEFT shift
- Dynamic LED Pattern Using RIGHT shift
- Dynamic LED Pattern Using Bitwise XOR
- Dynamic LED Pattern Using Bitwise OR
Class Material and Notes
Class Notes , Class Project
Raw Image
Key Learning Objectives
- Bitwise operations in Python
Bonus Videos
Independent Activity
Create a Python program that illustrates bitwise operations through manipulations on a monochrome image.
Class 9 – Connect Four (Turtle)
Class Videos
- Introduction and Learning Objectives
- Setting up the game screen — World Coordinates
- A function to draw the game board
- Creating a 2D list (a list of lists) to describe the board
- The concept of SHALLOW Copy in Python
- Drawing the board according to the items of the 2D list
- Function to determine the lowest available row in a given column
- Function to determine the open columns on the board
- Creating the player turn using the sreen.onclick() method
- Creating the function for the computer turn
- Implementing the game flow — alternating turns and checking for winner
- The big picture view of the function to determine winner
- A function to determine if all items of a list are the same
- A function to determine horizontal winners (along a single row)
- A function to determine vertical winners (along a single column)
- A function to determine positive sloping diagonal winners
- A function to determine negative sloping diagonal winners
- Putting together the checkwinner function
- The final gameplay and some enhancement ideas
Class Material
Key Learning Objectives
- Two dimensional lists
- Onclick statements in turtle
Bonus Videos
Independent Activity
Create a Connect Four game played against the computer
Class 10 – MineSweeper (Tkinter)
Class Videos
- Introduction and Learning Objectives
- Understanding the clues given during the game
- Creating a grid of buttons in Tkinter
- Storing buttons in a list of lists
- Introducing the two dimensional field list
- Sprinkling mines randomly across the minefield
- Our approach to find neighbors of a given square
- A function to find neighbors for the centre squares
- Dealing with edge/corner squares when finding neighbors
- Updating neighborhood information of each mine in the field
- lambda statements and onClick() function to handle button clicks
- Clicking on a square that contains a mine
- Clicking on a square with mines in its neighborhood
- Setting up the recursion to open up the field
- Conditions to get the two dimensional recursion to stop
- Determining the winner when the player has discovered all the mines!
Class Material
Key Learning Objectives
- Logic in two dimensional lists
- Application of recursion to solve a game
Bonus Videos
Independent Activity
Implement an interactive minesweeper in Tkinter.