South Plantation High School logo
South Plantation High School · Procedural Programming with Python

Multiple & Nested Conditionals Practice

and · or · not · multiple if statements · nested if statements · 30 practice items

Instructions

The information on this page is not stored. If you start an assignment, you must finish it. This page does not save your progress.

Quick review

Complex Boolean expressions
age >= 13 and age <= 19    # both True
day == "Sat" or day == "Sun"  # at least one
not is_raining              # flips it
Multiple if statements
if temp < 50:
    print("jacket")
if is_raining:
    print("umbrella")
Nested if statements
if has_key:
    if level >= 5:
        print("Door opens")
    else:
        print("Level up")
else:
    print("Find the key")

Error messages you may see in the terminal

How this works

  1. Enter your first name, last name initial, and class period, then click Start Assignment. Your start time is recorded.
  2. The assignment opens in a Python editor with four files (tabs). Each orange numbered box or drop down is one practice item. There are 30 items.
  3. Click ▶ Run on any part to see what Python prints. On Parts 1 to 3, compare it with the expected output. On Part 4, Run shows what each small program prints, so you can check your predictions. Run does not grade you, so check your work carefully.
  4. When you finish all four tabs, click Submit for Score. Your end time is recorded and your score appears. Answers cannot be changed after submitting.
PartTaskItemsPoints
1Complex Boolean expressions: and, or, not, ranges, the or trap, and parentheses1 to 88
2Multiple if statements: separate ifs vs. one elif chain9 to 157
3Nested if statements: indentation, inner chains, and rewriting with and16 to 238
4Predict the output of expressions and nested code24 to 307
Total (1 point per item)3030

Student Information

Reminder: nothing on this page is saved. Once you click Start Assignment, plan to finish before you leave or refresh the page.