Lesson 14 of 40Article12 min
Basics Practice & Review Path
After each lesson, rewrite examples without looking. Change values and predict output before running.
Python Exercises — practice habits
After each lesson, rewrite examples without looking. Change values and predict output before running.
Use the practice drills per chapter to confirm you understand lists, loops, and functions.
Real-life example: Practice is gym reps — reading teaches the move; typing code builds muscle memory.
Mini challenge — combine basics
Build a small grade tracker: read names and scores, store in a dict, print average and highest grade.
Use if/else, loops, functions, try/except, and f-strings together.
Real-life example: A class teacher's register — add students, fix mistakes, print summary at end of day.
Grade tracker sketch
def average(scores):
return sum(scores) / len(scores) if scores else 0
grades = {"Aarav": 88, "Meera": 94, "Riya": 91}
print("Average:", average(list(grades.values())))
print("Top:", max(grades, key=grades.get))