Results for “strip”

Showing 1–10 of 44

  1. 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
  2. Challenge

    Strings don't change

    code[0] = "X" stops with a TypeError, because Python strings can't be changed. Predict the crash, find out what methods and slices really give, build a new string instead, then swap a letter in the…

    Fix the code Easy 3 stages strings immutability slicing TypeError
  3. Challenge

    Skip blanks and comments

    …101.2 kPa 09:30:10 ENG-2: 415.0 C At the top of the loop, strip the line, then continue when it's empty or starts with # . Stripping first matters: one comment is indented, and a line can hold nothing…

    Write the code Medium 2 stages for loop continue strip startswith
  4. 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
  5. Challenge

    File name from data

    …. Then print it: File: eng-2_2026-03-14.csv Inside an f-string's braces you can call methods too: {sensor_id.lower()} . From a name The configuration form gives sensors names like Star Tracker A , and…

    Write the code Easy 3 stages strings f-strings lower replace
  6. Challenge

    Command parser

    …unknown command: dance REJECTED "": empty command text.strip().lower().split() gives the words. Converting the length can raise its own ValueError : catch it and raise yours, with a clearer message…

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

    Validate a command

    …START : Starting the sequence Normalise the answer with strip().lower() straight away, then compare it in an if / elif chain, with else at the end. Helpful errors Make the errors helpful. For an empty…

    Write the code Easy 2 stages if elif else input