Output in Python

To print anything to the console, python has a built-in print function similar to other high-level languages. Here we use the print() function to print anything to the console.

Program

# Print single object
print("Hello World")

# Print multiple objects
print("Hello", "world", "how", "are", "you?")

# Print a tuple
myTuple = ("Bike", "Car", "Bus", "Train", "Plane")
print(myTuple)

# Separator example
print("My name is", "John", sep = " : ")

Output

Hello World
Hello world how are you?
('Bike', 'Car', 'Bus', 'Train', 'Plane')
My name is : John