
Code
Hello, Pythonia!
Welcome, apprentice! I'm Pip, your guide in the Lantern Guild. The lanterns of Pythonia are going dark, and every program you write lights one back up. Let's light the first one together.
What is code?
Code is a list of instructions for a computer, written in a language the computer understands. Python is one of those languages. It's popular because it reads almost like English.
Your first instruction: print
print tells Python: "show this on the screen."
print("Good morning!")
When this runs, the screen (we call it the output) shows:
Good morning!
Three things matter:
- The word
printis all lowercase. - The round brackets
( )hold what you want to show. - Text goes inside quotes
" ", so Python knows it's text.
Pip tip: Don't worry about breaking anything. If Python is confused it shows an error message. That's a clue, not a punishment.
Assignment
- Write one line that prints exactly
Hello, Pythonia! - Press Run to see it, then Check to light the lantern.
- Write one line that prints exactly
Hello, Pythonia! - Press Run to see it, then Check to light the lantern.
main.py Python sleeping
Press Run to try your code, then Check to test it.