With the special instruction print()
, we tell the computer to display a value in an area called the console, also known as the shell.
Please enter print, hello world。
We can use the print()
instruction as often as we want. The computer displays every value on a new line in the console.
Let's coding print("3,2,1"), and next line, we are coding print("GO").
We can use print()
to display variables like greeting, too.
>>> print("Hello world!")
Hello world!
>>> print("3,2,1")
3,2,1
>>> print("Go!")
Go!
>>> greeting = "Hello world"
>>> print(greeting)
Hello world