Results for “comparisons”

8 results

  1. 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.

    Write the code Easy 2 stages if elif else comparisons
  2. Challenge

    Flag from config text

    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…

    Fix the code Easy 3 stages bool if else config
  3. Article Python Fundamentals

    Python If/Else for Beginners

    …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…

  4. Challenge

    Launch schedule digest

    …, 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…

    Write the code Medium 3 stages project json datetime timedelta
  5. Challenge

    Clear error messages

    …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…

    Write the code Medium 2 stages errors raise ValueError TypeError
  6. Article Mini projects

    Base 6 Number System in Python

    …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…