Quiz
Python If/Else Quiz
Free beginner quiz on Python if, elif and else: 15 questions on conditions, comparison and logical operators and indentation, with instant answers.
Showing 1–10 of 58
Quiz
Free beginner quiz on Python if, elif and else: 15 questions on conditions, comparison and logical operators and indentation, with instant answers.
Example
The else block executes when if condition is not met. Two possible paths.
Example
Multiple conditions with elif. Checking several possibilities in sequence.
Article Python Fundamentals
Learn Python if, elif, and else with clear, space-themed examples and hands-on exercises. Perfect for beginners who want to chart the control flow of their programs.
Challenge
…with an if/elif chain, print Unknown command for anything else, then handle empty input and show what was typed.
Challenge
…fix both errors one after the other, then write an if/else check yourself.
Challenge
…where it goes: .png or .jpg images .csv telemetry anything else rejected For the camera image in the starter code: cam-1_2026-03-14.png -> images/ Use endswith() for each extension, or to accept two…
Challenge
…temperature into OK, WARN or CRITICAL with if, elif and else and two thresholds, check the exact boundaries, then store the level in a variable for a status line.
Challenge
Choose New Norcia, Cebreros or Malargüe from the longitude under a spacecraft with an if/elif chain of ranges, then accept longitudes from 0 to 360 and reject values that can't be longitudes.
Challenge
…case and with stray spaces. Yes and true mean on; anything else means off. Print: Telemetry: on Telemetry: off Normalise the value first, as in "Normalise a command", then compare it with both words…