Examplary
Start for free
Oak ComputingTest · Computing

Building a program using control structures

The starter and exit quiz of the lesson “Building a program using control structures”, 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. What is the term for repeating a sequence of instructions multiple times in a program?
  2. In Python, which code is used to create a loop that repeats as long as a condition is True?
  3. What operator should be added to the gap to make the while loop run whilst the name entered is not equal to Sam?while name {operator here} "Sam":
  4. What is the primary purpose of a flag in programming?
  5. In a game, a player earns bonuses for collecting a certain number of coins. Which of the following would most likely cause a flag named bonus_earned to be set to True?
  6. A flag can have two states ___ and False.
  7. Which logical operator in Python would you use to check if at least one of two conditions is True?
  8. Which logical operator in Python would you use to check if both of two conditions are True?
  9. Which of these Python while loop conditions will keep the loop running forever, no matter what happens inside the loop?
  10. Which of the following is a potential benefit of combining programming structures?
  11. What is the output of the following Python code? is_weekend = Truehave_homework = Falseif is_weekend and not have_homework: print("Time to relax")else: print("Time to study.")

License: OGL

Building a program using control structures · Examplary