Year 7 · Quiz 2

Conditionals

10 multiple-choice questions on comparisons, if/elif/else, and logical operators. Matches Part 5 of the Year 7 tutorial.

Predict output Fill blanks Find errors
Fill in the blank

Question 1

Which operator means equal to when comparing two values?

Choose one answer
Predict the output

Question 2

What is printed when n = 8?

n = 8
print(n > 5)
print(n == 10)
Choose one answer
Predict the output

Question 3

points = 45

if points > 50:
    print("Gold")
elif points > 30:
    print("Silver")
else:
    print("Bronze")
Choose one answer
Find the error

Question 4

This code has mistakes. Which option best describes them?

number = int(input("Enter a number: "))
if number = 0
print("Zero")
Choose one answer
Predict the output

Question 5

With points = 75, what prints?

points = 75

if points > 30:
    print("Silver")
elif points > 50:
    print("Gold")
Choose one answer
Fill in the blank

Question 6

To check that a number is even, complete:

if number % 2 ___ 0:
Choose one answer
Logical operators

Question 7

What does n >= 8 and n < 10 give when n = 8?

Choose one answer
Predict the output

Question 8

password = "python123"
if password == "Python123":
    print("Access granted")
else:
    print("Access denied")
Choose one answer
Fill in the blank

Question 9

An if line must end with a ___.

Choose one answer
Find the error / cinema tickets

Question 10

Ages: under 12 pay £5; 12 to 64 pay £8; 65+ pay £6. Which condition order is correct for age 70?

Choose one answer

Previous: Quiz 1 · Year 7 tutorial · Next: Quiz 3