Examplary
Start for free
Oak ComputingTest · Computing

Logical operators

The starter and exit quiz of the lesson “Logical operators”, from the unit “Programming: selection” (Year 10 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. A ___ compares two values and produces the result of True or False.
  2. Match the arithmetic operator to the symbol:
  3. Write the if statement command to check if the value stored in the variable called num is 10 or more.
  4. What will be displayed if score is 5?if score < 5: print ("You lose")elif score <= 10: print ("Not bad!")else: print ("You win")
  5. What will be displayed if score is 10?if score < 5: print ("You lose")elif score <= 10: print ("Not bad!")else: print ("You win")
  6. What will be displayed if score is 11?if score < 5: print ("You lose")elif score <= 10: print ("Not bad!")else: print ("You win")
  7. What is the purpose of logical operators in programming?
  8. Which of the following is True when both conditions are True?
  9. The expression (5 > 3) and (10 < 20) evaluates to ___.
  10. Which logical operator is used to reverse the result of a condition?
  11. The expression (8 < 3) and (5 > 2) evaluates to ___.
  12. What will be displayed if the user inputs "king" for value and "hearts" for suit?if value == "king" and suit == "hearts": print("Match") else: print("Not a match")

License: OGL

Logical operators · Examplary