Space Python Loading Python…

CSV row

Write the codeEasy 3 stages

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 the most common way to move data between programs.

2026-03-14,ENG-2,412.5,C

Write the readings in that format. print() already puts something between the values you give it, a space unless you say otherwise, and sep lets you choose what.

The starter code prints the four values with spaces between them. Make it print a CSV row instead:

2026-03-14,ENG-2,412.5,C

Keep the four values as separate arguments and add sep="," at the end, inside the brackets of print(). No spaces after the commas: a program reading the file would keep them as part of the values.

Print the CSV row
Let print() add the commas

Finish stage 1 to unlock this stage.

A CSV file starts with a header row that names the columns, so anyone who opens it knows what each value means. Print the header above the reading:

date,sensor,value,unit
2026-03-14,ENG-2,412.5,C

Use a second print() with the four column names as separate texts, and the same sep.

Add the header row
Keep the reading live

Finish stage 2 to unlock this stage.

The flight engineer wants to paste readings straight into a spreadsheet. When you paste text with tabs between the values, the spreadsheet puts each value in its own cell. Print the same two rows with a tab between the values:

date	sensor	value	unit
2026-03-14	ENG-2	412.5	C

The gaps above are tab characters, not spaces. Inside quotes, a tab is written as a backslash and a t: sep="\t".

Separate the values with tabs
Keep the reading live
You're not logged in, so your progress is kept in this browser only. Log in to save it, and to use hints and solutions.

Hints

Print Parameters sep and end

print-parameters-sep-end.py
# Parameter sep changes the separator between items
print("Mercury", "Venus", "Earth", "Mars")
print("Mercury", "Venus", "Earth", "Mars", sep=" -> ")
print("Mercury", "Venus", "Earth", "Mars", sep="\n")

# Parameter end changes what appears at the end of print
print()
print("Countdown:", end=" ")
print("3", end="... ")
print("2", end="... ")
print("1", end="... ")
print("LAUNCH!")
Open the full example
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:].