Chapter Practice Arena
All ChaptersControl Flow Problems
Targeted practice challenges specifically curated for this chapter. Inspect hints, verify outputs, and check Pythonic solutions.
Difficulty:
Chapter:
Showing 6 challenges · 23 total · Page 1 of 4
Set score to 85. Print A for scores of at least 90, B for scores of at least 75 but below 90, C for scores of at least 60 but below 75, and D otherwise.
Starter Code
score = 85 # Write your conditional statement below
Expected Output:B
Set number to 15 and print whether it lies between 10 and 20, inclusive. Use a chained comparison.
Starter Code
number = 15 # Write your solution below
Expected Output:True
Write a for loop that prints the integers 4, 5, 6, and 7 on separate lines. Use the two-argument form of range().
Starter Code
# Write your solution below
Expected Output:4
5
6
7
Set score to 82 and attendance to 90. Print True only when the score is at least 60 and attendance is at least 75.
Starter Code
score = 82 attendance = 90 # Write your solution below
Expected Output:True
Set age to 17. Print Eligible if age is at least 18; otherwise, print Not eligible.
Starter Code
age = 17 # Write your conditional statement below
Expected Output:Not eligible
Set score to 75 and print whether the score is at least 60. Your program must display True.
Starter Code
score = 75 # Write your solution below
Expected Output:True