Results for “division”

5 results

  1. Challenge

    Packing crates

    …9 Tubes in the last crate: 4 Empty slots: 8 Rounding a division up is a classic trick: (tubes + slots_per_crate - 1) // slots_per_crate . Adding one tube less than a full crate pushes any leftover…

    Write the code Medium 2 stages floor division modulo rounding up //
  2. 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 // %
  3. Challenge

    Signal delay

    Divide a distance by the speed of light to get the radio delay to a Mars orbiter, show it in whole minutes and seconds, then add the round trip without doubling a rounding error.

    Write the code Medium 3 stages division round // %
  4. Challenge

    Tank level

    Turn a tank's capacity and contents into a fill percentage with one decimal place, then draw the crew display's ten-segment gauge with string repetition and int().

    Write the code Easy 2 stages percentage division rounding string repetition
  5. Challenge

    Readings summary

    …with no readings: an empty list would crash min() and the division. For an empty list, print only No readings . Min: 398.0 Max: 455.2 Mean: 419.5 Spread: 57.2 Check len(readings) == 0 first, and move…

    Write the code Easy 2 stages lists min max sum