Results for “end”

Showing 21–30 of 56

  1. Challenge

    Last five readings

    …The list is oldest first, so the most recent are at the end. A negative start counts from the end, as with strings. The window moves A new reading has arrived. Add new_reading = 772 under the list…

    Write the code Easy 2 stages lists slicing negative slice append
  2. Challenge

    Date and time from a timestamp

    …T , at index 11, and is 8 characters long. In text[start:end] , the character at end isn't included. The way we write it In Poland and much of Europe, dates are written day first, with dots…

    Write the code Easy 2 stages strings slicing indexing timestamp
  3. Challenge

    Normalise a command

    …show: Command: [launch] strip() removes spaces from both ends and lower() turns capitals into small letters. You can call one straight after the other: typed.strip().lower() . Does it match? Now check…

    Write the code Easy 3 stages strings strip lower replace
  4. Challenge

    Aligned status board

    …Because the names are all different lengths, the states end up scattered across the screen, and a HOLD is easy to miss. Line the states up in a column. Format specs can give each value a fixed width…

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

    CSV row

    The engine sensors on Python One send readings that end up in a CSV file: one reading per line, with commas between the values. Spreadsheets, databases and data tools all read CSV, which is why it's…

    Write the code Easy 3 stages print sep csv telemetry
  6. Challenge

    Daily mission report

    At the end of every day, the outgoing shift leaves a report for the incoming one: each subsystem, its status, its alerts and how much of the day it was up. People read it on a screen in a fixed-width…

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

    Flight software review

    …the error, fix it, and run again, until it runs to the end. Four bugs stop it: a syntax error, a type error, a missing key and an index out of range. Fix each one where the error points, without…

    Fix the code Hard 2 stages project debugging SyntaxError TypeError
  8. Challenge

    Test the pipeline

    …allowed and must give None . Keep the passed line at the end. The hidden tests now plant all three bugs, the third being >= instead of > in check_limits() .

    Write the code Hard 2 stages project testing assert try
  9. Challenge

    Test the error

    …and that 40 s needs 500.0 kg. Keep the passed line at the end. The hidden tests now also try a version that refuses 0, one with a vague message, and one that refuses every length.

    Write the code Medium 2 stages testing assert try except
  10. Challenge

    Catch what you expect

    …Three of the four readings look like numbers. How many end up in good ? Investigate and modify Investigate. Change except: to except Exception as error: and print type(error).__name__ in it, to see…

    Fix the code Medium 3 stages errors try except ValueError