print python syntax code example

Example 1: how to print something in python

print("whatever you want to print")

Example 2: print python

#try it :)
print("Hello, world!")

#or 

#you can print variable
name = "Harry"
print(name)


name = "Harry";print(name) #all on the same line

Example 3: 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 4: print in python

print("Text")

Tags:

Misc Example