Hello world program in Python programming. In this tutorial, you can learn how to write the hello world program in Python programming language using different ways.
The following program will print Hello World on the output screen.
You can also use single quotes like print('Hello World')
print("Hello World")
The following program will print Hello World in two lines on the output screen.
print("Hello\nWorld")
val = "Hello"
val2 = "World"
print(val, val2) #printing 'val' and 'val2' values.
print("Hello", end="") #'end=""' used for Continue Line.
print(" World!") #it printing 'Hello World!'.
val = "HiLaLs", "Khan", "Afridi" #assigning values to 'val'.
print(val)
Program Assigning Value to Multiple Variables
Program
a = b = c = 5 #assigning value to 'a', 'b' and 'c'.
print(a)
print(b)
print(c)