Results for “rounding up”

4 results

  1. Challenge

    Packing crates

    …Crates needed: 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…

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

    Float surprise

    Two small top-ups of fuel, 0.1 and 0.2 tonnes, go into the tank. Adding them up should be the easiest calculation on board, and yet Python prints something nobody expects. Predict it, look closely at…

    Write the code Easy 3 stages float floating point rounding formatting
  3. Challenge

    Downlink time

    …to the second. Show whole minutes and seconds instead, rounding to the nearest second first. For a 1250 MB file at 6 Mbit/s: Downlink time: 27 min 47 s The same trick as in "Signal delay": round, then…

    Write the code Medium 3 stages input float bits and bytes round