Python Mastery – From Basics to Brilliance / Introduction to Python

Writing Your First Python Script (Hello World)

Printing Your First Python Program – Hello World

Let’s begin with the traditional first program: Hello World!

Using VS Code or any code editor:

Create a Python file in your project folder.

Example

  • test.py

  • hello.py

  • yourfilename.py

Write the following code:

print("Hello, World!")   # Output: Hello, World!

Need help creating the file or setting up the editor?
Check the previous chapter’s reference video.


Running the Program

Method 1: Using Terminal
Open the terminal and run:

python yourfilename.py

Method 2: Using VS Code Run Button
Click the Run button at the top-right corner of VS Code.