Starter quiz

  • What is an example of an input device?
    • a monitor
    • a speaker
    • a button  ✓
    • a printer
  • Which of the following is an example of an output?
    • a keyboard
    • a mouse
    • a microphone
    • an LED display  ✓
  • What is the purpose of an 'if statement' in programming?
    • to repeat a block of code multiple times
    • to store data in a variable
    • to make decisions based on a condition  ✓
    • to print a message to the screen
  • Which of the following is an example of a condition that can be used in an if statement?
    • `"Hello, world!"`
    • `10`
    • `temperature > 25`  ✓
    • `print("Welcome")`
  • What will be the output of the following Python code? ``` age = 15 if age >= 18: print("You can vote!") else: print("You cannot vote yet.") ```
    • You can vote!
    • You cannot vote yet.  ✓
    • 15
    • An error message.
  • Which of the following are valid ways to represent a condition in Python?
    • `x == 5`  ✓
    • `name != "Bob"`  ✓
    • `score = 100`
    • `temperature < 0`  ✓
+