Results for “and”

Showing 51–60 of 150

  1. Challenge

    Duration formatter

    Split 100,000 seconds of mission time into hours, minutes and seconds with // and %, pad it to a 27:46:40 clock, then add days in the DDD/HH:MM:SS format.

    Write the code Easy 3 stages floor division modulo // %
  2. Challenge

    Waypoint distance

    …distance between two waypoints on a rover map with ** 2 and ** 0.5, then add a third waypoint and print each leg and the length of the whole route.

    Write the code Easy 2 stages exponent square root ** Pythagoras
  3. Challenge

    Running totals

    Predict how -= and += change a fuel level, track it through three burns and a top-up, then follow a battery through one orbit. A PRIMM challenge on updating variables.

    Write the code Easy 3 stages variables -= += updating values
  4. Challenge

    Round or cut?

    int() cuts the decimals off, round() rounds, and round(2.5) gives 2. Predict the difference, investigate Python's rounding rule, then round a fuel reading two ways.

    Write the code Medium 3 stages int round rounding type conversion
  5. Challenge

    Legacy script

    …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 catch either function breaking.

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

    Launch schedule digest

    …keep the launches still 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
  7. Challenge

    JSON out

    …mission summary dict into JSON text with json.dumps() and indent=2, see what True, False and None become, then keep the station's Polish letters readable and sort the keys so the files compare easily.

    Write the code Easy 2 stages json json.dumps modules import
  8. Challenge

    Live T-minus

    …formatter": work out the seconds left from the launch time and datetime.now(timezone.utc) instead of a number typed by hand, then turn it into a countdown() that counts up with T+ after launch.

    Write the code Medium 2 stages datetime datetime.now timezone countdown
  9. Challenge

    Log to a file

    …with with open(), one per line, read the file back and print it, then add an append_entry() function that adds lines at the end without wiping what is there.

    Write the code Easy 2 stages files open with write