Hello, Python!
Send your first message, just like a Mars rover.
Hello, Python! 👋
Far away on Mars, a robot called Perseverance is driving around, taking photos and studying rocks. 🚙🔴 How does it talk to scientists on Earth? It runs code: instructions written by people, telling the computer exactly what to do.
Today you write code. Your first instruction is print(). Whatever you put inside the brackets, Python shows on the screen.
print("Hello, Earth!")
print("Rover is awake")Words need quotes 💬
Words and sentences (coders call them strings) go inside quotes " ". The quotes tell Python: "this is text, just show it."
Numbers don't need quotes:
print("Photos taken today:")
print(12)💡🧠 Remember: every
print()starts a new line.
Printing more than one thing
Put a comma between things, and Python adds a space for you:
print("Distance driven:", 150, "meters")🌍 Fun fact
A message from Mars takes between about 5 and 20 minutes to reach Earth, depending on where the two planets are. So the rover can't be steered like a toy car: it follows the code it was sent!
Your turn: type the examples into the box below and press Run ▶.
Type it yourself
Don't just read it — type the example from above into the box, press Run ▶, and watch what happens. Typing it yourself is how it really sticks! Stuck? Tap Show example.
Press ▶ Run to see your code come to life…