Examplary
Start for free
Oak ComputingTest · Computing

Selection with multiple paths

The starter and exit quiz of the lesson “Selection with multiple paths”, from the unit “Introduction to Python programming” (Year 8 Computing) by Oak National Academy.

Free to use. Edit it, share it and hand it out to your students.

Oak National Academy

12 questions

  1. Which of the following Python expressions evaluates to True?
  2. Which Python code is used to create a block of code that will run based on whether something is True or False?
  3. What is the output when the program is run?score = 7if score > 5: print("score is greater than 5")else: print("score is not greater than 5")
  4. Which logical operator in Python checks if two conditions are **both** True?
  5. What will be the output of this Python code?is_raining = Trueis_cold = Falseif is_raining or is_cold: print("Stay indoors")else: print("You can go outside!")
  6. Arrange the following components of an if-else statement in the correct order.
  7. Which of the following statements accurately describes multi-path selection in Python?
  8. In Python, what is used to introduce an additional condition in a multi-path selection statement after an initial if statement?
  9. What will be the output of the following Python code?grade = 75if grade >= 90: print("A")elif grade >= 80: print("B")elif grade >= 70: print("C")else: print("Fail")
  10. What is the primary purpose of indentation in Python code, especially in the context of if, elif, and else statements?
  11. Which of the following is correct when describing nested if statements?
  12. A game gives points based on a dice roll:Roll 1 or 2: lose a point.Roll 3, 4, or 5: no change.Roll 6: win a point.Which Python code is best for this?

License: OGL

Selection with multiple paths · Examplary