
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How you will create your first program in Python?
When we are starting with Python, mostly created first program will be "Hello, World", which prints the statement "Hello, World" as the output.
Before we begin with the first program, we need to install Python in our system from the official website.
Choose a Code Editor
After installing Python, we need to select the text editor based on our requirements and usage. Following are the different editors available -
- IDLE: It comes pre-installed with Python
- VS Code: A popular and lightweight code editor
- PyCharm: This is useful for building larger Python projects
- Notepad++: It is used for basic, quick edits
Creating the First Program
Create a new file with the name hello.py and write the following code in this script -
# This is the first Python program print("Hello, World!")
If you want to execute the above script in terminal follow the steps below -
- Open the terminal or command prompt.
- Then navigate to the directory where we saved hello.py file.
- Next execute the following command:
python hello.py
Following is the output of the above program -
Hello, World!
Advertisements