Learn Python

Print In Python

Printing is a fundamental aspect of programming that allows you to display information on the screen.


print("message to print")

To print in python we use the print() function, Inside the function we put the message to print enclosed in quotes.

Basic Usage

print("Hello Developers")

Click on the Run Code button to the run the code and you should see Hello Developers as output. It is because inside the print function we put Hello Developers.

Printing Variables

A variable is like a container which we use to store information like numbers, words etc. We can print the information inside the variables using the print().


name = "Jason"
age = 18


The above program will print Jason and 18 as we have given the variable name in the print statement it will print the information stored in the variable.

Printing Variables With Labels

We don’t know what it printed because it doesn’t have a label. So, we can place text in the first part of the print function, followed by the variable.


name = "Jason"
age = 18

print("Name: ", name)
print("Age:", age)