The traditional first program. It shows that Python is installed and working, and it teaches the one function you will use more than any other: print().
The program
python
print("Hello, World!")
output
Hello, World!
How it works
print()is a built-in function. It writes whatever you give it to the screen and then moves to a new line.- The text inside the quotes is a string. You can use double quotes or single quotes, as long as both ends match.
Try changing it
Each call to print() starts a new line, so three calls print three lines:
python
print("Hello, World!") print("My name is Ada.") print("I am learning Python.")
output
Hello, World! My name is Ada. I am learning Python.