Space Python Loading Python…

String Methods - upper, lower, strip

 
0:00 / 0:00

Challenge

Practise what this example shows with these challenges.

Normalise a command

Write the codeEasy 3 stages

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.

Start the challenge

Accept the right files

Write the codeEasy 2 stages

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.

Start the challenge

Sign-up cleanup

Write the codeMedium 2 stages

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 one.

Start the challenge

Discussion

Stuck on this example or want to go further? Ask here, or see what others asked.

Log in to ask and reply.

script.py
PythonLn 1, Col 1Spaces: 4
Loading the Python environment…

Separate arguments with commas. They're passed on every Run as sys.argv[1:].