0% found this document useful (0 votes)
13 views2 pages

Install and Run Python Beginners

This document provides a step-by-step guide for beginners on how to install and run a Python program. It includes instructions for installing Python on Windows, macOS, and Linux, checking the installation, writing a simple 'Hello, world!' program, and running it via the command line. Additionally, it recommends installing a code editor like VS Code for a better coding experience.

Uploaded by

disha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views2 pages

Install and Run Python Beginners

This document provides a step-by-step guide for beginners on how to install and run a Python program. It includes instructions for installing Python on Windows, macOS, and Linux, checking the installation, writing a simple 'Hello, world!' program, and running it via the command line. Additionally, it recommends installing a code editor like VS Code for a better coding experience.

Uploaded by

disha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

How to Install and Run Python Program for Beginners

1. Install Python
For Windows:

1. Go to the official website: https://www.python.org/downloads


2. Click "Download Python 3.x.x.(download latest)
3. Run the downloaded .exe file.
4. Make sure to check the box: "Add Python to PATH".
5. Click "Install Now".

For macOS:

- You can use the same website to download and install Python.
- Alternatively, install using Homebrew:
brew install python

For Linux:

Use your package manager:


sudo apt update
sudo apt install python3

2. Check Python Installation

Open Command Prompt (Windows) or Terminal (Mac/Linux) and type:


python --version
or
python3 --version

You should see something like:


Python 3.12.0

3. Write Your First Python Program

You can write Python code in any text editor (Notepad, VS Code, etc.).
Example: Hello World Program

Create a new file named hello.py and write:


print("Hello, world!")

4. Run Your Python Program


Method 1: Using Command Line

1. Open Terminal or Command Prompt.


2. Navigate to the folder where hello.py is saved using cd command:
cd path\to\your\file
3. Run:
python hello.py
or
python3 hello.py

You will see:


Hello, world!

5. Optional: Install a Code Editor (Recommended)

Install VS Code: https://code.visualstudio.com/


- Install the Python extension (search "Python" in Extensions).
- Open your .py file and click "Run".

Summary
Step Action

1 Install Python from python.org

2 Confirm with `python --version`

3 Create a .py file

4 Write `print("Hello, world!")`

5 Run with `python filename.py`

You might also like