Examplary
Start for free
Oak ComputingTest · Computing

Iteration using while loops

The starter and exit quiz of the lesson “Iteration using while loops”, 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

11 questions

  1. You can use multiple elif blocks.
  2. A program calculates a theme park ticket price by first checking the users age and then checking if it is peak season or not. Which of the following is used in the program?
  3. Match the relational operator to it's description.
  4. What will be the output of the following Python code?score = 50if score >= 80: print("Win")elif grade >= 50: print("Try again")else: print("You lose")
  5. Which of the following statements about nested if statements is true?
  6. A school organises students based on age. Students 11-16 attend High School, and students 16-18 Sixth Form. Which expression correctly checks if a student's age falls within the High School range?
  7. What does 'iteration' mean in programming?
  8. What is the purpose of a flag in programming?
  9. What while loop should you use if you want a block of code to run forever?
  10. In Python, which of the following is a way to create a flag variable named is_game_over and set its initial value to False?
  11. What is treasure_found in this code?distance_traveled = 0treasure_found = Falsewhile treasure_found == False: print(f"Keep going {distance_traveled} steps travelled so far")

License: OGL

Iteration using while loops · Examplary