Skip to main content

Getting Started with Python 🚀

Mentor's Note: Starting a new programming language is like learning to ride a bike — wobbly at first, but once you get going, you'll never forget. This guide will get you from zero to coding in minutes! 💡


🌟 The Scenario: Setting Up Your Digital Kitchen 🍳

Imagine you're about to cook a new recipe.

  • The Problem: You need a stove (Python), utensils (an editor), and ingredients (your code). 🍽️
  • The Solution: This guide walks you through getting your stove installed, your utensils picked, and your first dish cooked. ✅
  • The Result: You'll have a fully working Python environment and the confidence to write your very first program.

What is Python?

Python is a high-level, interpreted programming language known for its clean, English-like syntax. It was created by Guido van Rossum and released in 1991. Python is the #1 language for beginners because it lets you focus on logic rather than confusing punctuation.

👉 Learn more about what Python is →

🎨 The Python Ecosystem


Why Learn Python?

ReasonWhy It Matters
Easy to ReadSyntax reads like English — you'll write real programs on day one
Huge CommunityMillions of developers, thousands of free tutorials
Batteries IncludedThe standard library handles files, web, math, and more
Career OpportunitiesUsed in web dev, data science, AI, automation, and gaming
Cross-PlatformWrite once, run on Windows, Mac, and Linux

Installing Python

Windows 🪟

  1. Go to python.org/downloads and click the yellow download button.
  2. Run the installer (.exe file).
  3. 🚨 CRITICAL: Check the box "Add Python 3.x to PATH" at the bottom of the installer.
  4. Click Install Now and wait for the setup to finish.
# Open Command Prompt and type:
python --version
# Output: Python 3.12.x

macOS 🍎

  1. Download the macOS installer from python.org/downloads.
  2. Open the .pkg file and follow the prompts.
  3. Alternatively, install via Homebrew: brew install python3.
# Open Terminal and type:
python3 --version
# Output: Python 3.12.x

Linux 🐧

Python usually comes pre-installed on Linux. If not:

# Debian / Ubuntu / Mint
sudo apt update && sudo apt install python3 python3-pip -y

# Fedora
sudo dnf install python3 python3-pip -y

# Verify
python3 --version

👉 For a detailed step-by-step guide, visit the Python Installation Guide.


Verifying Your Installation

Once Python is installed, open your terminal (Command Prompt, PowerShell, or Terminal) and run:

# Check Python version
python --version
# If that doesn't work, try:
python3 --version

# Check pip (Python's package manager)
pip --version
pip3 --version

If you see version numbers (e.g., Python 3.12.5), you're all set! ✅


Your First Python Program

Create a new file called hello.py and type exactly this:

print("Hello, World!")

How to Run It 🏃

Open your terminal in the same folder as hello.py and type:

python hello.py

You should see:

Hello, World!

Congratulations! You've just written and run your first Python program! 🎉


The Python REPL (Interactive Mode)

Python comes with an interactive shell called the REPL (Read-Eval-Print Loop). It lets you type Python code and see results instantly — no file needed.

Open your terminal and type:

python

You'll see something like:

Python 3.12.5 (main, Aug 8 2024, 12:00:00)
[GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

The >>> prompt means Python is waiting for your command. Try this:

>>> print("Hello from the REPL!")
Hello from the REPL!
>>> 2 + 2
4
>>> exit()

Pro Tip: The REPL is great for testing small snippets of code before adding them to your program.


Choosing an Editor / IDE

You can write Python in any text editor (even Notepad!), but a good editor makes coding faster and more enjoyable.

Quick Comparison

Editor/IDEBest ForFeaturesPlatform
VS CodeEveryoneExtensions, debugger, Git, terminalWindows / Mac / Linux
PyCharmProfessional projectsSmart autocomplete, refactoring, database toolsWindows / Mac / Linux
ThonnyAbsolute beginnersBuilt-in Python debugger, simple UIWindows / Mac / Linux
IDLEQuick testsComes with Python, minimal, lightweightWindows / Mac / Linux

Recommendations

  • Total beginner? Start with Thonny — it shows how variables work step-by-step.
  • Ready for real projects? Use VS Code — install the Python extension for syntax highlighting and debugging.
  • Building a large app? Use PyCharm — its smart autocomplete saves hours.

💡 Pro Tip: Don't get stuck choosing an editor. Start with IDLE (it comes with Python) and upgrade when you feel limited.



💡 Pro Tip: "The best time to start was yesterday. The next best time is now." — Write your first print() statement today!


← Back: Python Roadmap | Next: What is Python? →