Results for “for”

Showing 21–30 of 136

  1. Challenge

    Launch schedule digest

    …to come, sort them by their window and print a digest line for each with the time left and any hold, then switch the digest to the live clock.

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

    Retry the uplink

    Send a command up to three times, taking each result from a list of simulated radio replies, and stop at the first success with break; then wait 2, 4, 8 seconds between attempts, as real retry code…

    Write the code Medium 2 stages for loop range break retry
  3. Challenge

    Test the alert levels

    Write assert checks for alert_level(): one temperature for each level first, then the values exactly on each threshold and just below them, so a > written instead of >= can't slip through.

    Write the code Medium 2 stages testing assert functions boundaries
  4. Challenge

    Test the parser

    Write assert checks for parse_line() from "Parser function": the whole record for a good line first, then None for a blank line, a comment and a line with a missing field, so a broken parser can't…

    Write the code Medium 2 stages testing assert parsing None
  5. Challenge

    Skip blanks and comments

    Extend the feed parser so continue skips blank lines and comment lines, then report damaged lines with too few fields instead of crashing, with a count of parsed and damaged lines.

    Write the code Medium 2 stages for loop continue strip startswith
  6. Challenge

    Legacy script

    A 70-line engine report repeats the same twelve lines for each engine. Restructure it into parse_feed() and summary_line() with the output unchanged to the character, then add assert tests that would…

    Fix the code Hard 2 stages project refactoring functions testing
  7. Challenge

    Shift rota

    …In turn Build rota , a list of (day, shift, name) tuples for every shift of the week, in order, taking the crew in turn. Print one line per day, then count how many times one person works two shifts…

    Write the code Hard 2 stages project scheduling lists tuples
  8. Challenge

    Names with values

    Print each sensor name with its reading by looping over two lists together with zip(), then add a third list of units and warn when the lists don't have the same length, since zip() quietly stops at…

    Write the code Easy 2 stages for loop zip lists unpacking
  9. Challenge

    Parse the whole feed

    Go through a block of telemetry line by line with splitlines(), split each line at the commas and print the sensor and value, then unpack the four fields and show the clock time too.

    Write the code Easy 2 stages for loop splitlines split unpacking
  10. Challenge

    Validate a command

    …in any case with an if/elif chain, print Unknown command for anything else, then handle empty input and show what was typed.

    Write the code Easy 2 stages if elif else input