Accept the right files
The upload tool sends telemetry files to the mission archive, but only CSV files from the telemetry/ folder belong there. Last week someone uploaded a photo and a backup file, and the archive's import broke for a day.
Check every path before it's accepted, then make the checks work for paths typed on a Windows PC.
Finish stage 1 to unlock this stage.
Print whether the path starts with telemetry/ and whether it ends with .csv:
In telemetry/: True CSV file: True
path.startswith("telemetry/") and path.endswith(".csv") each give True or False. Use them rather than in: ".csv" in path would also be true for old.csv.bak.
Finish stage 1 to unlock this stage.
This path was typed on a ground station PC: Windows backslashes, capitals and spaces around it. The starter code says False twice, although it's exactly the right file. Clean the path first, then check the clean version:
In telemetry/: True CSV file: True
Remove the spaces, turn backslashes into forward slashes and make it lower case. Inside quotes, a single backslash is written as "\\".
Hints
String Methods - upper, lower, strip
# String methods - cleaning and checking text
# Imagine a noisy transmission coming in from a deep space probe
raw_signal = " voyager 1: still alive "
# .strip() removes whitespace from both ends
clean = raw_signal.strip()
print("Cleaned:", clean)
# .upper() and .lower() change case
print("Shouted:", clean.upper())
print("Whispered:", clean.lower())
# .title() capitalizes each word - useful for names and headers
print("Headline:", clean.title())
# Checking how a string starts or ends
mission_id = "ARTEMIS-II-2026"
print("Is Artemis?", mission_id.startswith("ARTEMIS"))
print("From 2026?", mission_id.endswith("2026"))
# Replacing parts of a string
log_entry = "Engine status: nominal"
print("Updated:", log_entry.replace("nominal", "OPTIMAL"))
Separate arguments with commas. They're passed on every Run as sys.argv[1:].