🎯 Learning Objectives
- Use iteration (for statements) to iterate over strings of characters
- Used variables to keep track of counts and sums
- Combine key programming language features to develop solutions to meaningful problems
💬 Key Vocabulary
- Input
- Output
- Variables
- Assignment
- Expressions
- Selection
- Boolean/logical expression (condition)
- String operations
- List
- Index (within a list)
- List item
- List operations
🥇 Level 1 – Sums in a for loop
Modify the Sums program so that a for loop is used to achieve the same results. Read the green # comments to see what you need to do.
Task 1 – for loop
Task 2 – while loop
🥈 Level 2 – for loops on strings
Use for to iterate over strings and do some counting and summing. Read the green # comments to see what you need to do.
Task 1 – Count the vowels
Task 2 – Sum the digits
🥉 Level 3 – Mini-projects
Select and complete at least one of these programming mini-projects:
Planetary quiz
Ask questions about the positions of the planets in the solar system.
Password safety
Check if a given password meets a set of common safety criteria.
Caesar’s cipher
Encrypt a text message using one of the oldest known cryptographic methods
Book Checker
Every published book comes with an International Standard Book Number (ISBN). Check if a given ISBN is valid or not.
Download the relevant sheet to guide you through the project and code required.
Use Thonny on your computer to code the solution required for your chosen project.
💭 How confident do you feel?
Download the handout below and fill in the boxes for each programming concept on a scale from 1-4 based on how confident you feel about each concept. Then upload it to Teams.
💬 Summary
In this lesson, you…
- Used variables to keep track of counts and sums
- Used iteration (for statements) to iterate over strings of characters
- Practised applying what you have learnt by attempting a mini project.
In this topic you have…
- Reviewed and practised previous knowledge and experience of Python from previous units
- Learnt about and used lists
- Learnt about and used strings
- Learnt about and used iteration (loops)
- Applied your python skills to creating a program for a defined task (mini-project)