Getting Started with Python: Install and Run Your First Program

Python is one of the most beginner-friendly and powerful programming languages you can learn today. Whether you’re diving into web development, data science, automation, or just want to explore coding, Python is a great starting point.

In this post, we’ll walk you through how to:

  1. Install Python
  2. Set up a code editor
  3. Write and run your first Python program

Let’s get started!


Step 1: Install Python

Windows / macOS / Linux

  1. Go to the official website:
    👉 https://www.python.org/downloads/
  2. Download the latest version:
    Click on the button to download the latest version of Python (e.g., Python 3.12.x).
  3. Run the installer:
    • ✅ On Windows, make sure to check the box that says “Add Python to PATH” before clicking “Install Now.”
    • ✅ On macOS, follow the installation prompts.
    • ✅ On Linux, you can usually install Python via terminal: sudo apt update sudo apt install python3
  4. Verify the installation:
    Open a terminal or command prompt and type: python --version or python3 --version You should see something like: Python 3.12.0

Step 2: Choose a Code Editor

While you can write Python in any text editor, using a proper code editor makes things easier.

Recommended Editors:

After installing, open your editor and create a new file called hello.py.


Step 3: Write Your First Python Program

In your hello.py file, type the following code:

print("Hello, world!")

This line tells Python to print the phrase Hello, world! to the screen.


Step 4: Run the Program

Option 1: Using Terminal or Command Prompt

Navigate to the folder where your hello.py file is located, then run:

python hello.py

or

python3 hello.py

You should see:

Hello, world!

Option 2: Run Inside Your Code Editor

If you’re using VS Code, right-click in the editor window and click “Run Python File in Terminal”.

If you’re using PyCharm, click the green triangle (▶️) next to your code.


Congratulations! 🎉

You’ve just written and run your very first Python program. From here, the possibilities are endless. Try changing the message, or explore input/output, variables, and basic math next.


What’s Next?

Here are a few beginner-friendly projects you can try:

Python is your canvas. Happy coding!


Did you find this helpful? Feel free to share and leave a comment with your first program!


Leave a comment

Design a site like this with WordPress.com
Get started