Printing to the console

3.1.2. Printing to the console#

To print anything to the console, we use the print function:

print(1 + 2)
print(3 + 4)
3
7

The print function works with any contents, be it numbers or words:

print("Hello world")
Hello world

Important

Python is case-sensitive. This means that a is not the same thing as A. Consequently,

Print("Hello world")

or

PRINT("Hello world")

would result in an error because neither Print or PRINT exists. However,

print("Hello world")

works.