Python Program to Print Hello world || single quotes, double quotes, and triple quotes

Python Program to Print Hello world

Python Program to Print Hello world

A simple python program that displays output “Hello World”

#Python program to print hello world

print(‘Hello World’)

Output:- 

Hello World

Note:- In this example, we used a built-in print () function to print “Hello World” String.

In python single quotes, double quotes, and triple quotes are used to print strings. So we can also use double quotes and triple quotes to print Hello World

print(“Hello World”)
print(“””Hello World”””)
print(”’ Hello World ”’)

Output:-

Hello World
Hello World
Hello World

Note:- Actually Triple Quotes are used to print multi-line String.

Example:-

print(“””Hello World
  This is My first Python Program”””)
print(”’ Hello World 
This is My first Python Program with triple quotes ”’)

Output:-

Hello World
This is My first Python Program
Hello World
This is My first Python Program with triple quotes

If you like my post please share it with your friends by simply clicking the below social media button, and Don’t forget to comment so we will update ourselves.

Share in a Single Click

Leave a Reply

Your email address will not be published. Required fields are marked *