Environment check
A navigation script works on one computer and fails on another. The first question anyone on the software team asks is: which Python were you running? Every useful bug report starts with that line, because the same code can behave differently in different versions.
Python can tell you itself. Write the first lines of a bug report for the Python One flight software, filled in by Python rather than typed by hand.
Finish stage 1 to unlock this stage.
The starter code imports the platform module. platform.python_version() asks Python which version is running your code and gives the answer as text, like 3.13.2.
Print that answer. Put platform.python_version() inside print() without quotes: it isn't text for Python to copy, it's a question for Python to answer. Your version may differ from the example, so the test shows it as <version>.
Finish stage 1 to unlock this stage.
In a terminal, the command python --version prints a line like Python 3.13.2, and bug reports usually quote it in that form. Make your program print the same line, with the version your Python reports:
Python 3.13.2
print() can show several values at once: separate them with commas, and it puts one space between them. In the test, the real version appears as <version>.
Finish stage 2 to unlock this stage.
The second thing a bug report needs is where the code ran. sys.platform names the system: win32 on Windows, darwin on a Mac, linux on Linux. The starter code now imports sys as well. Add a second line:
Python 3.13.2 Platform: emscripten
Here you'll see emscripten: this editor runs a version of Python built for the web, inside your browser. Unlike platform.python_version(), sys.platform has no brackets, because it's a value you read, not a function you call. The test shows the platform as <platform>.
Hints
Check Python Version
# Check Python version
import sys
# Display full version information
print("Python version:", sys.version)
# Check major and minor version numbers
print("Version:", sys.version_info.major, ".", sys.version_info.minor, sep="")
# Verify minimum version for your mission
min_version = (3, 8)
current = (sys.version_info.major, sys.version_info.minor)
if current >= min_version:
print("Systems go. Python version is compatible.")
else:
print(f"Warning: Python {min_version[0]}.{min_version[1]}+ required for this mission.")
Separate arguments with commas. They're passed on every Run as sys.argv[1:].