Challenge
Alert level
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.
8 results
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.
Challenge
A config file says dry_run is False, yet bool("False") turns it into True and the engine simulates instead of firing. Predict it, find out why, compare the text instead, then read yes/no settings…
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.
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…
Challenge
…and the function stops with a confusing TypeError from the comparison. Check the type first and raise your own TypeError , naming the type that came in: 500.0 Refused: burn length can't be negative…
Article Mini projects
…which means "one group of six, plus zero ones." Here's a comparison table to make this click. Let's count from 0 to 12 in both systems: Decimal (Base 10) Senary (Base 6) What's happening 0 0 Same in…