Quiz
Python If/Else Quiz
…on Python if, elif and else: 15 questions on conditions, comparison and logical operators and indentation, with instant answers.
Showing 1–10 of 18
Quiz
…on Python if, elif and else: 15 questions on conditions, comparison and logical operators and indentation, with instant answers.
Example
When to use tuples instead of lists? Comparison of properties and applications.
Challenge
…you added before you check. Modify. Work dry_run out by comparing the text with "True" , so it is a real True or False. With the config saying "False" it must print: Firing the main engine Make…
Challenge
Turn an engine 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.
Example
Checking if a set is a subset or superset of another set.
Challenge
Compare yesterday's and today's cargo IDs with set difference to print what was added and what was removed, then count what stayed with an intersection and print none for an empty change.
Challenge
…sensor didn't answer and temperature_c is None . Run it: comparing None with a number stops with a TypeError . Check for None first, so it prints: ENG-2: NO DATA Use temperature_c is None , and move…
Challenge
…field names, then find the hottest temperature reading, comparing the values as numbers.
Article Python Fundamentals
…Here's what you'll use most often when writing conditions: Comparisons: == , != , < , > , <= , >= Logical operators: and , or , not Membership: in , not in Truthiness: values like 0 , "" , [] , None…
Challenge
…, returning the parsed datetime, works for the comparison and as the key for sorted() . strftime("%Y-%m-%d %H:%M") formats a datetime. Time left, and holds Add the time left to each launch, as days…