Class 1 – Introduction
Class Material and Notes
Independent Activity
Revise Level 1 Concepts and Projects
Get your Replit account up and running
Revise the Level 1 Projects
Class 2 – Secret Messages Part 1
Class Videos
- Introduction
- How to index strings with positive and negative numbers
- String slicing: start, stop, step size in string slicing, with examples
- String slicing and plus operator to jumble even and odd letters
- Modulo operator to determine even or odd string length
- What is the return statement in context of Python functions?
- How to slice strings with a negative step size?
- How to slice strings with a negative step size?
- How to use string slicing to reverse a given string?
- Split() method and reverse function to reverse every word
- How to use string slicing to swap the first and second halves of a string
- How to use string slicing to swap the first and second halves of a string
- A bonus encoding and decoding — swap middle and reverse combined
Enhancement Ideas/Videos
Bonus Encodings/Decodings
1. Generalized EVEN/ODD swap with N-letter chunks
Encoding, Decoding
2. Generalized SWAP MIDDLE with N-chunks in the message
Encoding, Decoding
3. Encoding messages by lumping every Nth letter (Row Column transpose)
Encoding, Decoding
4. Arbitrary column order in the row/column transpose encoding
Encoding, Decoding
5. Secret Messages using Rail Fence cipher with N-rails
Encoding, Decoding
Interesting Presentation of Secret Messages
1. Presenting Secret Messaged in 5 letter groups
Encoding, Decoding
Class Material and Notes
- String slicing with positive and negative values
- Functions, return statement
Class 3 – Secret Messages Part 2
Class Videos
- Introduction
- How to build a Caesar Cipher?
- Why and how to use the modulo operator in the Caesar cipher?
- Making Caesar cipher work for capital letters and numbers
- How to decode a Caesar cipher?
- Our encryption technology goes into wrong hands!
- How to generate random integers using random.randint()
- How to build the enemy encoder using the functions already built?
- Cracking the enemy code when the transposition is set to ‘No Change’
- Cracking enemy code when the transposition encoder is set to even odd swap
- Cracking the enemy code even when the encoder is randomly chosen
Class Material and Notes
Key Learning Objectives
- encoding/decoding using caesar cipher
- Creating an encoder
- break statement
Bonus Videos
More Substitution Ciphers
1. Atbash Cipher (Encoding and Decoding)
2. Vigenere Cipher – A generalization of the Caesar Cipher
Encoding, Decoding
3. Beaufort Cipher – A variation of the Vigenere Cipher
Encoding, Decoding
Cracking Enemy Code
1. Equal Length Enemy Headers randomly chosen from a list
Basic but not very flexible code,
A more flexible and useful code
2. Unequal Length Enemy Headers randomly chosen from a list
3. Enemy headers placed anywhere in the message — Excellent practice in slicing
4. Enemy Headers contained in each other? Did the Enemy trick us?
Independent Activity
Class 4 – Card Game WAR
Class Videos
- Introduction and Learning Objectives
- Game Rules
- Creating a Deck of Cards
- Shuffling the Deck of Cards
- Doing the toss!
- Dealing the cards to the two players using list slicing
- Understanding the game scheme: A nested while loop
- Getting both players to play a card using the pop method
- Checking for a winner in a move
- The difference between append and extend methods for lists in Python
- Setting up the WAR
- Four different methods to delete items from a list in Python
- Develop the outer loop
- Print statements to display the list status and interpreting the results
15. Determine the final winner
Class Material and Notes
Key Learning Objectives
- nested while loop
- random.choice() and random.shuffle
- Deleting items from a list
Bonus Videos
Enhance the Toss
Both players pick up 1 card
Winner by a combination of suit and value
Both players pick up multiple cards
Joker
Add Joker card to the gameplay
Innovative ways to deal cards
Using List Slicing and Loops
Incorporating Randomness
WAR Game Variants
Progressive WAR
Speed WAR
WAR played with suits
Active Role for player and computer
Player chooses from the first three cards
Computer chooses from the first three cards
Independent Activity
Class 5 – Birthday Countdown
Class Videos
- Introduction
- Getting User’s inputs for the birthday countdown: year, month, day of birth
- How to import datetime module, what does import mean?
- Create the datetime object using the year, month and day of birth
- Getting a better understanding of datetime objects
- Using lists and weekday() method to determine the weekday of birth
- Creating a datetime object to hold the current time
- Determining if the next birthday will come this year or in the next year
- A closer look at the syntax of the if-else condition
- Determining the weekday for the next birthday
- Starting to think about creating the birthday countdown!
- Understanding the timedelta object
- The logic for converting total seconds to hours, mins, seconds
- What are modulo (%) and floor division (//) operators in Python?
- Modulo and floor division operators to convert seconds to hours, minutes and seconds?
- Use divmod () method to convert total seconds to hours, minutes and seconds?
- Create a dynamic countdown towards next birthday!
- How to use ‘\r’ to print the birthday countdown on the same line?
- Common problems when using ‘\r’ for printing the dynamic countdown!
Bonus Videos
- Try/except statements for a graceful exit after invalid inputs
- How to prevent the user from giving a birth date that is in future?
- How to tell the user’s age based on the birth date provided?
- Using string split method and list indexing to extract hours, minutes and seconds
- How to tell the user the weekdays of all the birthdays till now?
- How to handle the special day of 29th February?
Class Material and Notes
Key Learning Objectives
- Datetime object
- Dynamic printing
Independent Activity
Activity and Marking Criteria
Bonus Ideas
Create a REPL (python) which asks for the player’s birthday and creates a countdown towards the next birthday.
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 – Metro Map in Tkinter
Class Videos
- Introduction and Learning Objectives
- Getting started with Tkinter
- Customizing the Tkinter window
- The widgets we will use; Adding the canvas widget
- Methods of the Canvas widget with examples
- Drawing the first line (The scratch line) on the Canvas
- Adding the dropdown menus to select the stations
- Adding the CALCULATE FARE button and the FARE DISPLAY label widgets
- Adding the function for the button command and the pass statement
- Calculating the fare when start and stop stations are on one line
- Adding the second (Python) line to the network map and dropdown menus
- Computing the fare with two lines and an interchange station
- Challenges in computing fares with more than two lines
Class Material & Notes
Key Learning Objectives
- Introduction to Tkinter.
- Basic Widgets
- pack() placement of widget
Bonus Videos
Flexible Placement of Lines
Use a function to create inclined lines
Create turns on the lines
Place Labels in a flexible manner
Fare Enhancements
Base fare + per station fare
Surcharge for changing lines
Different fares on the two lines
GUI Enhancements for Discounts
Checkboxes to select discount options
RadioButtons to select Age Category
Independent Activity
Create a REPL (Tkinter, with turtle) which highlights a metro map and gives user a choice of starting and ending stations for calculation of the fare. .
Class 8 – Calculator in Tkinter
Class Videos
- Introduction and Learning Goals
- Understanding the grid geometry manager
- Adding the Expression Label and the Entry label
- Adding rows of buttons
- What does the ‘sticky’ option mean?
- The high level architecture — 4 types of buttons, 2 labels
- Getting ONE number button to work
- Making all the number buttons work using lambda functions
- A brief introduction to lambda functions in Python
- Getting the operator buttons to work using lambda functions
- Getting the CLEAR button to work
- Getting the EQUALS button to work using the EVAL statement
- Handling errors using try/except statement
- Comparing our calculator app with the standard windows app, and several enhancement ideas
Class Material and Notes
Key Learning Objectives
- grid placement in Tkinter
- lambda functiona
Bonus Videos
Independent Activity
Create a REPL (python, with Tkinter) which implements a basic calculator.
Class 9 – Wordle
Class Videos
- Introduction and Learning Objectives
- Getting started with Tkinter
- Getting a large list of words and picking up a random word
- Planning the GUI — Creating Entry box and button using the grid manager
- Determining if the guessed word is a valid word
- Creating Labels for the letters of valid words using the grid manager
- Placing every new guess on a new row using the global keyword
- A closer look at variable scopes and the global keyword
- Giving color to every label according to the game rules
- Understanding the problem with repeated letters in the guessed word
- Analysis of the repeated letters problem and its solution
- Implementing the solution in code
- Generalizing the solution to the repeated letters problem using lists
- Implementing the ending conditions in the Wordle game
Class Material
Key Learning Objectives
- Importing data from files
- global statement
Bonus Videos
Independent Activity
Create a REPL (python, with Tkinter) which implements a basic WORDLE game.
Class 10 – Hungry Traveling Snake
Class Videos
- Introduction and Learning Objectives
- Getting started
- Getting the head to move
- Getting the TURTLE head to turn with ts.onkey()
- Creating the foods and storing in a list
- Determining if the food is being eaten?
- A closer look at t.distance()
- How to set the threshold for the touching conditions?
- How to make the first segment of tail move along with the SNAKE head?
- Making all the segments move along with the SNAKE Head
- An alternative implementation based on the Snake Game from Scratch
- Displaying the SCORE as the Snake eats the food
- Getting the game to END
- Displaying the total number of steps taken to complete the mission
- Relating to the TRAVELING SALESMAN problem
Class Material
Key Learning Objectives
- Key bindings in turtle using ts.onkey()
- Creating and manipulating Lists of Turtles
- Multiple Turtles in the same project.
- Connection to an important business problem called the Traveling Salesman Problem.
Bonus Videos
Playing Boundary
Square Shape, Circle Shape
Enhancements inside the playing area
An initial cool off time
Poison Fruit (Must not eat)
Obstacle (Stay away from this)
Snake dies on eating own tail (Self Goal)
Secret passages and going across border
Bouncing off border
Smart Placement of foods
No two foods come too close to each other
Specific Orders of Eating
Snake must eat foods in a specific order
Computing the nearest neighbor order (Traveling Salesman Problem)
Highlighting the nearest neighbor order at all times
Snake in an AUTO Mode
Snake moves around the finds the food itself, by going to the nearest neighbor.
Fancy Shape for snake head
Give a fancy shape to the snake head
Independent Activity
Implement a Hungry snake game in Python Turtle