← Winnitude! Search  ·  Reader Mode (860 ms)
Links: Stay in Reader Retro Site Converter Retro Mode: OFF Original Page ↗
PROGRAMIZ · 78 LINKS

Your First Python Program | Programiz

Online Python Online JavaScript Online SQL Online Java Online HTML Online C Online C++ Online C# Online PHP Online Swift Online Kotlin Online TypeScript Online Go Online Rust Online Scala Online Dart Online R Online Ruby

Popular Tutorials

Getting Started With Python Python if Statement while Loop in Python Python Lists Dictionaries in Python Start Learning Python

Reference Materials

Built-in Functions List Methods Dictionary Methods String Methods View all

Certification Courses

Created with over a decade of experience and thousands of feedback.

Learn Python Learn HTML Learn JavaScript Learn SQL Learn DSA Learn C Learn C++ Learn Java View all Courses on

Popular Tutorials

Getting Started With Python Python if Statement while Loop in Python Python Lists Dictionaries in Python Start Learning Python All Python Tutorials

Reference Materials

Built-in Functions List Methods Dictionary Methods String Methods View all Python online compiler JavaScript online compiler SQL online compiler Java online compiler HTML online compiler C online compiler C++ online compiler C# online compiler PHP online compiler Swift online compiler Kotlin online compiler TypeScript online compiler Go online compiler Rust online compiler Scala online compiler Dart online compiler R online compiler Ruby online compiler

Your First Python Program

In this tutorial, you will learn to write your first Python program.

In the previous tutorial, you learned how to install Python on your computer. Now, let's write a simple Python program.

The following program displays Hello, World! on the screen.

print("Hello, World!")

Output

Hello World!

Note: A Hello World! program includes the basic syntax of a programming language and helps beginners understand the structure before getting started. That's why it is a common practice to introduce a new language using a Hello World! program.


Working of the Program

Congratulations on writing your first Python program. Now, let's see how the above program works.

Hello World Code
Hello World Code

In Python, anything inside print() is displayed on the screen.

There are two things to note about print():

  • Everything we want to display on the screen is included inside the parentheses ().
  • The text we want to print is placed within double quotes " ".

We can also use single quotes to print text on the screen. For example,

print('Hello World!')

is same as

print("Hello World!")

To be consistent, we will be using double quotes throughout the tutorials.

Next, we will be learning about Python comments .

Share on: Did you find this article helpful?

Table of Contents

Previous Tutorial: Get Started With Python Next Tutorial: Python Comments

Related Tutorials

Python Tutorial

Python Keywords and Identifiers

Python Tutorial

Python Nested Dictionary

Python Tutorial

Python Exception Handling

Python Tutorial

Python Decorators