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.

Sample Python Program to Print Hello World

This Sample program uses the print function and displays the hello world.

print("Hello World")

output

Hello World

Print Custom Message

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

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