In the previous tutorial you learnt how to install Python on your computer. Now, let's learn how to write a simple Python program.
We will write a simple program that displays Hello, World!
on the screen.
print("Hello, World!")
Output
Hello World!
Working of the Program
Let's see how the above program works:
In Python, anything inside print()
is displayed on the screen.
There are two things to note about print()
:
- Everything we want to display on the screen is included inside the parentheses
()
. - The text we want to print is placed within double quotes
" "
.
We can also use single quotes to print text on the screen.
For example,
print('Hello World!')
is same as
print("Hello World!")