top of page
Loops
This page features 3 levels of projects to teach you how to use loops in Python:
1. Using for and while loops to repeat actions a set number of times
2. Creating tables / patterns using nested loops
3. Combining loops with lists / number operations
Level 1: Repeat Repeat Repeat
Goal: Ask for a word and a number, print the word that many times with numbers
Level 2: Times Tables
Goal: Ask a user for a number, and create a table with that many rows and columns with each item being a product of the row and column number.
Level 3: Data Cleaner
Goal: Given a list of mixed inputs (strings, booleans, numbers), convert everything to floats and get rid of everything else. Count how many are valid, invalid, and the percentage of valid inputs.
bottom of page