Results for “number formatting”

9 results

  1. Challenge

    Units and separators

    …deck wants to count digits during a launch. Format the numbers for people: a sensible number of decimal places, thousands separators and the right units. The stored values stay exact; only the way…

    Write the code Easy 3 stages f-strings number formatting rounding telemetry
  2. Challenge

    Live T-minus

    Extend the formatter from "Duration 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…

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

    Landing site

    …2021. Mission planners store every site as a pair of numbers, latitude and longitude, that always belong together and in that order. Keep the pair in a tuple, unpack it, then print it the way maps and…

    Write the code Easy 2 stages tuples unpacking formatting coordinates
  4. Challenge

    Float surprise

    …prints after the decimal point for total and store the number in digits_after_point . Modify. Keep the raw value, and under it add the line the fuel display shows, rounded to two decimal places…

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

    Duration formatter

    …as 01:02:05 . In an f-string, {minutes:02d} pads a whole number with zeros to two digits. Days too Long missions count days as well. Mission control displays often write elapsed time as days, a slash…

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

    Daily mission report

    …a fixed-width font. The engineering office wants the same numbers as a spreadsheet. Produce both from the same data. Fixed width Print the report, WIDTH characters wide: the title and the mission line…

    Write the code Medium 2 stages project formatting f-strings alignment
  7. Challenge

    Aligned status board

    …gets a third column: each system's temperature in °C. Numbers read best aligned to the right, so their decimal points line up. Give the states a width of 6, and make the temperature column 7…

    Write the code Medium 3 stages f-strings alignment tables formatting
  8. Challenge

    Signal delay

    …then for the round trip. Python lets you write big numbers with underscores, like 225_000_000 , so you can read them at a glance. Delay in seconds Work out how long a radio signal takes to reach the…

    Write the code Medium 3 stages division round // %