def exercise_1_basics(): """ Goal: Practice basic syntax and string formatting. Task: Create variables for a course name and a number of students. Print a sentence using an f-string. """ # TODO: Print "The course [course] has [students] students."
def exercise_2_collections(): """ Goal: Manipulate lists and dictionaries. Task: 1. Create a list of 5 colors. 2. Add a 6th color to the end. 3. Create a dictionary with keys 'name' and 'gpa'. """
def exercise_3_logic(): """ Goal: Use loops and conditionals. Task: Iterate through a list of numbers. If a number is even, add it to a new list called 'evens'. """
if name == "main": print("--- Exercise 1 ---") exercise_1_basics() print("\n--- Exercise 2 ---") exercise_2_collections() print("\n--- Exercise 3 ---") exercise_3_logic()