Sample Python Program

Write a sample Python program to Print Hello World or any custom message. It is a basic or a traditional program to start any programming language. It also helps you to understand the print function in Python.

Sample Python Program to Print Hello World

This Sample Python program prints the hello world. The following print statement print Hello World in Python.

# Sample Python Program to Print Hello World

print("Hello World")

Hello World program output

Hello World

Sample Python Program to Print Custom Message

This sample Python program allows the user to input their own message. Next, this Python program prints that message.

# Sample Python Program to Print Message

str = input("Welcome to Tutorial Gateway")
print(str)
Sample Python Program 2