How do I display a message on the console in Python?
15May, 2022
How Can We Help?
Created On
byMatt
Print
You are here:
< Back
Maker of websites,
Teacher,
Cat enthusiast
Teacher,
Cat enthusiast
Latest posts by Matt (see all)
- The 2022 End of Year Website Update - 01/01/2023
- Celebrating Ada Lovelace day - 10/10/2022
- Website update 5/9/22 - 05/09/2022
To display a message onto the console screen in Python you should use the print statement. For example:
print("Hello, my what a lovely day it is!")
The print statement can contain any collection of letters or numbers as long as they are wrapped within the speech marks. Anything within the speech marks is known as a string.
A print statement can also be used to display variables onto the console screen. For example:
x = "Hello World"
print(x)
This will display “Hello World” to the console screen.
Learn more about strings here:
Matt
administrator
Maker of websites,
Teacher,
Cat enthusiast