Your First Python Program | Programiz
Popular Tutorials
Getting Started With Python Python if Statement while Loop in Python Python Lists Dictionaries in Python Start Learning PythonReference Materials
Built-in Functions List Methods Dictionary Methods String Methods View allCertification 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 onPopular Tutorials
Getting Started With Python Python if Statement while Loop in Python Python Lists Dictionaries in Python Start Learning Python All Python TutorialsReference 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 compilerYour 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.
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 CommentsRelated Tutorials
Python Tutorial
Python Keywords and Identifiers
Python Tutorial
Python Nested Dictionary
Python Tutorial
Python Exception Handling
Python Tutorial
Python Decorators