MyInternships.in

Python Basics

Python Installation and Setup

Before you can write Python programs on your own computer, you need to install Python and pick a place to write code. This guide covers Windows, Mac and Linux.


Installing Python on Windows

  1. Go to python.org/downloads and download the latest Python 3 installer
  2. Run the installer and tick the box "Add Python to PATH" — this step is important
  3. Click "Install Now" and wait for setup to finish
  4. Open Command Prompt and confirm the install

Installing Python on Mac

macOS often ships with an old Python version, so install the latest one separately. Download the macOS installer from python.org, or if you use Homebrew, run brew install python3 in the terminal.

Installing Python on Linux

Most Linux distributions include Python already. To install or upgrade it on Debian/Ubuntu-based systems, use your package manager.

Installing Python on Ubuntu/Debian
Terminal
sudo apt update
sudo apt install python3 python3-pip

Checking Your Python Version

Once installed, always confirm the installation by checking the version number from your terminal or command prompt.

Check the installed version
Terminal
python --version
# or on Mac/Linux
python3 --version

Choosing an Editor: IDLE vs VS Code

Python comes bundled with a simple built-in editor called IDLE, which is fine for quick tests. For serious practice, most developers use Visual Studio Code (VS Code) with the free Python extension, which adds auto-complete, error highlighting and an integrated terminal.

💡

If installation feels tricky, you can still practice everything in this tutorial using a free online Python compiler in your browser — no setup required.

Writing and Running Your First Script

Create a new file named hello.py, add one line of code, save it, then run it from your terminal.

hello.py
Python
print("Python is set up correctly!")
Running the script
Terminal
python hello.py

Related Python Topics

Keep learning with these closely related lessons.

Ready to use your Python skills?

Find Python, data science and software internships and fresher jobs across India.

Browse Python Internships