Results for “strings”

Showing 21–30 of 65

  1. Challenge

    Parse a telemetry line

    …a piece by its index, the same way as a character in a string: fields[0] is the first. Lists get a stage of their own later. The value as a number split() gives text, so "412.5" + 273.15 would stop…

    Write the code Easy 2 stages strings split parsing csv
  2. Challenge

    Daily mission report

    Turn the day's subsystem status into a fixed-width report for the shift handover, with aligned columns and a totals line, then save the same data as a CSV file with csv.DictWriter for the spreadsheet…

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

    Sign-up cleanup

    Clean the crew sign-ups for the analogue mission: trim and capitalise names, lower-case emails, then reject sign-ups with no name or a broken email and drop duplicates by email, saying why for each…

    Write the code Medium 2 stages project strings strip split
  4. Challenge

    Command parser

    Write parse_command(), which turns typed commands such as burn 12.5 or set mode safe into tuples and raises ValueError with a reason for anything malformed, then run a whole batch of commands and…

    Write the code Medium 2 stages project parsing strings split
  5. Challenge

    Validate a command

    Read a console command with input(), accept start, stop and status in any case with an if/elif chain, print Unknown command for anything else, then handle empty input and show what was typed.

    Write the code Easy 2 stages if elif else input
  6. Challenge

    Accept the right files

    Check whether a path starts with telemetry/ and ends with .csv using startswith() and endswith(), see why in isn't enough, then clean up paths with Windows backslashes, capitals and spaces first.

    Write the code Easy 2 stages strings startswith endswith paths
  7. Challenge

    Off-by-one slice

    A slice meant to take the number from the container tag CG-0042 gives -004. Predict it, work out where indexes start and where a slice ends, fix it, then slice a sample label yourself.

    Fix the code Easy 3 stages strings slicing indexing off-by-one
  8. Challenge

    Telemetry report

    Extend the parser from "Parse a telemetry line" to read three readings from a multi-line feed, print each as one row, then turn them into a report with a header and aligned columns.

    Write the code Medium 2 stages strings split slicing f-strings
  9. Challenge

    Decimal comma

    An operator types 42,5 and float() crashes with a ValueError. Predict it, find out why, accept both commas and dots with replace(), then read pressures written like 1 013,25.

    Fix the code Easy 3 stages strings replace float ValueError
  10. Challenge

    Normalise a command

    Turn " Launch " into launch with strip() and lower(), check it against the command list, then accept underscores and dashes too, so commands match however operators type them.

    Write the code Easy 3 stages strings strip lower replace