🐍 Python · Beginner start guide · with Pyodide editor

Introduction to Python Programming

Python is a beginner-friendly programming language used for web development, automation, data analysis, AI/ML, scripting, and more. This page helps you start from zero — and lets you run Python in the browser.

Easy syntaxReadable code, great for beginners.
Huge ecosystemThousands of packages with pip.
Practice instantlyRun Python below (no install needed).

1) What is Python?

Python is a high-level, interpreted language. “Interpreted” means you can run Python code without compiling it into a separate executable first. Python focuses on readability and has a clean syntax.

Where Python is used:
  • Automation (rename files, read Excel, scrape data, send messages)
  • Web development (Django, Flask, FastAPI)
  • Data + AI (pandas, NumPy, scikit-learn, PyTorch)
  • Scripting and tooling (DevOps, testing, CI/CD)

2) Setup: Install Python & choose an editor

Option A: Install on Windows / macOS / Linux

  1. Download Python from the official site (see Links).
  2. On Windows: during install, tick “Add Python to PATH”.
  3. Verify in terminal/command prompt:
    python --version
    
    pip --version

Option B: Start online (no installation)

Use the Pyodide editor below to run Python directly in your browser.

Recommended editor

VS Code

Best all-round editor. Add the “Python” extension and you’re ready.

PyCharm (Community)

A full IDE focused on Python (heavier but powerful).

3) Your first Python program

Create a file named hello.py and write:

print("Hello, World!")

Run it in terminal:

python hello.py

4) Python basics you must know

4.1 Variables (store data)

name = "Champak"

age = 20 pi = 3.14159 is_student = True

4.2 Data types (common ones)

# String

city = "Varanasi"

Integer and Float

count = 10 price = 99.50

Boolean

is_open = False

List (ordered, changeable)

nums = [1, 2, 3]

Tuple (ordered, not changeable)

point = (10, 20)

Dictionary (key-value)

student = {"name": "Asha", "marks": 92}

Set (unique items)

unique = {1, 2, 2, 3}  # becomes {1, 2, 3}

4.3 Input and output

name = input("Enter your name: ")

print("Hello,", name)

4.4 Conditions (if / elif / else)

marks = 72

if marks >= 90: print("Grade: A") elif marks >= 75: print("Grade: B") else: print("Grade: C")

4.5 Loops (repeat work)

# for loop

for i in range(5): print(i)

while loop

n = 3 while n > 0: print("Countdown:", n) n -= 1

4.6 Functions (reuse code)

def add(a, b):
return a + b

result = add(3, 4) print(result)

4.7 Imports (use libraries)

import math

print(math.sqrt(81))

5) Packages, pip, and virtual environments

Python has a package manager called pip. Install packages like this:

pip install requests
Pro tip: Use a virtual environment so each project has its own packages.

Create a virtual environment

# create venv

python -m venv .venv

activate (Windows)

.venv\Scripts\activate

activate (macOS/Linux)

source .venv/bin/activate

Then install packages inside it

pip install requests

6) Mini practice (do these today)

  1. Print your name and age in one line.
  2. Take two numbers as input and print their sum.
  3. Check if a number is even or odd.
  4. Print numbers 1 to 20 using a for loop.
  5. Make a function that returns the square of a number.

7) Pyodide Python Editor (Run Python in Browser)

Click Load Pyodide first. If you opened the page as file:///, use a local server (VS Code Live Server) or host the page.

⚠️ You opened this page as file:///.
Many browsers block loading Pyodide from CDNs in local-file mode.
Fix: open using VS Code Live Server (http://localhost) or host on GitHub Pages.
Click “Load Pyodide”
CDN:
Tip: press Ctrl + Enter to run

Output

Output will appear here…
If you get “stuck”, avoid infinite while True loops. Use for i in range(...) or a counter.

8) What to learn next