print(), explained simply
A computer does exactly what you tell it, nothing more. The simplest instruction you can give in Python is print(). Whatever you put inside the brackets appears on the screen.
When you want to show words, wrap them in quotation marks. The quotes tell Python "this is text, show it exactly as it is". Words inside quotes are called a string.
You can write as many print() lines as you like. Python runs them from top to bottom, one after another, so the order of your lines is the order your messages appear.
Example: Say hello
print("Hello, Pip!")
print("Let's build something today.")Output
Hello, Pip!
Let's build something today.Try this
- Print your own name, then your favourite animal on the next line.
- Remove one quotation mark on purpose and read the error Python gives you. Errors are clues, not failures.
- Print a tiny picture using three lines of symbols, like a smiley face made of letters.
