0
0
Pythonprogramming~5 mins

First Python Program (Hello World)

Choose your learning style9 modes available
Introduction

We write a first program to learn how to tell the computer to show a message. It helps us start coding step by step.

When you want to check if your Python setup is working.
When you want to learn how to print messages on the screen.
When you want to understand the basic structure of a Python program.
Syntax
Python
print("Hello, World!")

The print() function shows text on the screen.

Text to show is put inside quotes inside the parentheses.

Examples
This prints the classic greeting message.
Python
print("Hello, World!")
You can use single or double quotes for text.
Python
print('Hello, World!')
You can print any message you want.
Python
print("Welcome to Python!")
Sample Program

This program prints the message "Hello, World!" on the screen.

Python
print("Hello, World!")
OutputSuccess
Important Notes

Make sure to use parentheses () with print in Python 3.

Quotes can be single ' or double ", but they must match.

Summary

The print() function shows messages on the screen.

Start with printing "Hello, World!" to learn how Python works.