Python Print() Function

The print function presents information to the user.

Let’s try a quick example:

>>> print()

Using the above print function shows us a blank line. That’s it. We need to add whatever we want to print in between the parenthesis:

>>> print("Hello World")
Hello World

Looking good, we can now see our string. You might wonder what the difference is with just typing the string like this:

>>> "Hello World"
'Hello World'

This also shows us our string, including quotes. Why do we need the print function? In this example, we use the Python interpreter which always outputs information to the screen like this. If you would run a Python script without the interpreter, you wouldn’t see the string like this.

Ask a question or start a discussion by visiting our Community Forum