Results for “division”

Showing 1–10 of 14

  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. Article Python Fundamentals

    Numbers and Basic Math Operations in Python

    …fuel: {remaining_fuel} liters") Multiplication and Division # Calculate rocket thrust force (F = m * a) mass = 1000 # kg acceleration = 9.81 # m/s² thrust_force = mass * acceleration print(f"Thrust…

  6. Article Mini projects

    Base 6 Number System in Python

    …composite number, making it more practical for everyday division. Fractions like 1/2 and 1/3 come out clean in base 6 (0.3 and 0.2 respectively), while in our decimal system, 1/3 gives us the…