Results for “module”

Showing 11–20 of 20

  1. Challenge

    Seeded simulation

    Simulate 100 sensor readings, each with a 5% chance of a glitch, and seed random with 42 so the count is the same on every run and a test can check it exactly, then pick a kind for each glitch with…

    Write the code Easy 2 stages random random.seed random.choice simulation
  2. Challenge

    Alert banner

    …============================== ALERT: Cabin pressure low Module: Habitat 2 Action: Crew to suits ============================== Each new line inside the text needs its own \n . Title in the border…

    Write the code Medium 3 stages f-strings escape sequences new line formatting
  3. Challenge

    Names that explain

    Somebody wrote a quick calculation for the cargo module and called the variables a , b , x2 and tmp . The program works, but nobody, including its author a month from now, can tell what it calculates…

    Fix the code Easy 3 stages variable names refactoring readability clean code
  4. Challenge

    Manifest line

    …in order. A new field The manifest now also records the module each item is stowed in. The starter code stops with ValueError: too many values to unpack , because the tuple has four values and only…

    Write the code Easy 2 stages tuples unpacking ValueError formatting
  5. Challenge

    Shift rota

    Build the station's weekly shift rota: three shifts a day, the crew taken in turn so nobody works two shifts in a row, with a check that proves it, then plan around days off while keeping the work…

    Write the code Hard 2 stages project scheduling lists tuples
  6. 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 // %
  7. Challenge

    Packing crates

    Work out how many 12-slot crates 100 sample tubes fill with // and %, then how many crates they need and how full the last one is, including the case where the tubes fit exactly.

    Write the code Medium 2 stages floor division modulo rounding up //
  8. Challenge

    API response

    …a launch and it answers with JSON, which Python's json module turns into a dict in one line. The mission planners' dashboard only needs three of its fields. Read those fields, then look at everything…

    Write the code Easy 2 stages dictionaries keys items JSON