Results for “number formatting”

Showing 1–10 of 11

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

    Python print() Function

    …telescope_temp_3) Multiple values display in formatted way Some systems provide timestamps with measured data. It's helpful to see the temperature value with the last measured date and time. This…

  3. 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
  4. 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
  5. 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
  6. 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 // %
  7. 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
  8. 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