python pring code example

Example 1: print() in python

print('hi, baby!')

Example 2: print in python

# Simple Print:
print("Hello World!")

# Formatting message in python3.6- :
name = "World"
print("Hello {}!".format(name))

# Formatting message in python3.7+ :
name = "World"
print(f"Hello {name}!")

Example 3: python print

print("Hello, World!") #Output: Hello, World!

print(5+5) # Output:10

x=10
y=11
print(x+y) #Output: 21

Example 4: print in python

words = 'Hello', 'World', 'Python', 'makes', 'life', 'easier'
print(*words, sep='\n')

Tags:

Php Example