English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Python basic tutorial

Python flow control

Python Functions

Python Data Types

Python file operations

Python objects and classes

Python date and time

Advanced knowledge of Python

Python reference manual

Python beginner program prints 'Hello world!'

A simple program that displays 'Hello, World!'. It is usually used to illustrate the syntax of a language.

Source code

# This program prints 'Hello, world!'
print('Hello, world!')

Output result

Hello, world!

In this program, we use the built-in print() function to print the string 'Hello, world!' on the screen.

By the way,  StringIt is a sequence of characters. In Python, strings are enclosed in single quotes, double quotes, or triple quotes.