Python Tutorial for Beginners (Episode 1)
Welcome to the first episode of our Python series! You may be a complete beginner or switching from another language. Either way, this tutorial will take you from zero to coding — one step at a time.
By the end of this post, Python will be installed and you'll have written your first program.
What is Python?
It is a programming language created by Guido van Rossum and released in 1991. It uses clean, English-like syntax that is easy to read. You can write code in fewer lines compared to languages like C++ or Java.
Why Learn It in 2026?
- Beginner-friendly — reads like plain English, perfect for first-time coders
- Massively versatile — web development (Django, Flask), data science (Pandas, NumPy), AI/ML (TensorFlow, PyTorch), automation, game development
- Huge job market — consistently one of the most in-demand skills worldwide
- Strong community — millions of developers, thousands of free libraries and frameworks
- Free and open-source — no license costs, runs on Windows, macOS, and Linux
Fun Fact: Python was named after the comedy show "Monty Python's Flying Circus" — not the snake!
How to Install It (Step by Step)
Step 1: Download It
- Visit the official website: python.org
- Hover over Downloads and click the latest Python version for your operating system
- Choose the correct installer (Windows / macOS / Linux)
Step 2: Run the Installer
- Windows: Run the
.exefile — check the box "Add Python to PATH" at the bottom, then click "Install Now" - macOS: Run the
.pkgfile and follow the on-screen instructions - Linux: Python usually comes pre-installed. Run
python3 --versionin your terminal to verify
Step 3: Verify Installation
Open your terminal (Command Prompt / PowerShell / Terminal) and type:
python --version
You should see output like:
If you see a version number — you're ready to go!
Your First Program: Hello, World!
Every programming journey starts with "Hello, World!" — and Python makes it incredibly simple.
Open any text editor (Notepad, VS Code, PyCharm, or IDLE) and type:
print("Hello, World!")
How to Run It
- Save the file as
hello.py - Open your terminal in that folder
- Run the command:
python hello.py
You'll see:
You just wrote and executed your first program! Here's what happened:
| Part | Meaning |
|---|---|
print() | A built-in function that displays output to the screen |
"Hello, World!" | A string (text) passed as an argument to the function |
# | Used for comments — Python ignores everything after # |
Using It as a Calculator
It also works as a calculator. First, type python in your terminal and press Enter to start the REPL (you'll see >>> appear). Then try these:
5 + 3 # Addition 8 10 - 4 # Subtraction 6 6 * 7 # Multiplication 42 15 / 4 # Division (returns decimal) 3.75 15 // 4 # Floor division (rounds down) 3 15 % 4 # Modulo (remainder) 3 2 ** 10 # Exponentiation 1024
To exit the REPL, press Ctrl+Z then Enter (Windows) or Ctrl+D (Mac/Linux). You can also type exit() or quit().
Understanding Variables
Variables are containers for storing data. The language is dynamically typed — you don't need to declare the type; it figures it out automatically.
name = "Alice" # string — text inside quotes age = 25 # int — whole numbers height = 5.6 # float — decimal numbers is_student = True # bool — True or False print(name) # Alice print(age) # 25
Variable Naming Rules
- Must start with a letter or underscore
- Can contain letters, numbers, and underscores
- Case-sensitive —
name,Name, andNAMEare all different - Cannot use reserved keywords like
if,else,while,class
✅ my_var playerScore _count user2
❌ 2pac my-var class
Common Data Types
| Type | Example | Description |
|---|---|---|
int | 42, -10, 0 | Whole numbers |
float | 3.14, -0.5, 2.0 | Decimal numbers |
str | "Hello", 'Python' | Text (single or double quotes) |
bool | True, False | Logical values |
NoneType | None | Represents "no value" |
Check any variable's type with type():
print(type(age)) # <class 'int'> print(type(name)) # <class 'str'>
Getting User Input
Make your programs interactive with input():
name = input("What is your name? ")
print("Hello, " + name + "!")
When you run it:
Hello, John!
input() always returns a string. Use int() or float() to convert to numbers when needed.Mini Project: Age Calculator
Let's combine everything into a small, useful program:
# Age Calculator
name = input("Enter your name: ")
age = int(input("Enter your age: "))
current_year = 2026
birth_year = current_year - age
print(f"Hello {name}!")
print(f"You were born in {birth_year}.")
print(f"You will turn 100 in the year {birth_year + 100}.")
Sample Run:
Enter your age: 25
Hello Priya!
You were born in 2001.
You will turn 100 in the year 2101.
f"..." is an f-string — it lets you embed variables directly inside strings using curly braces {}. We'll cover them in detail in Episode 2.Common Beginner Mistakes (and Fixes)
| Mistake | Wrong Code | Fix |
|---|---|---|
| Missing quotes | print(Hello) | print("Hello") |
| Missing parentheses | print "Hello" | print("Hello") |
| Case-sensitive error | Print("Hello") | print("Hello") |
| Using undefined variable | print(x) | Define x first: x = 10 |
What You Learned Today
- What it is and why it's one of the most popular languages
- How to install and verify it on your machine
- The
print()function and writing your first program - Using it as a calculator in the REPL
- Variables, naming rules, and basic data types (
int,str,float,bool) - Getting user input with
input() - Your first mini project — an Age Calculator
What's Coming in Episode 2
In the next tutorial, we'll dive deeper into:
- Strings in depth — concatenation, slicing, and built-in methods
- Lists & Tuples — storing collections of data
- If/Else conditions — making decisions in code
Bookmark this series and follow along — we'll go from basics to advanced!
Frequently Asked Questions (FAQ)
Open your terminal and run:
python --version
On Linux/macOS, you might need:
python3 --version
You can also check from within Python code:
import sys print(sys.version)
It depends on your goals and consistency:
| Goal | Typical Time |
|---|---|
| Basics (variables, loops, functions) | 2–4 weeks |
| Build small projects independently | 1–3 months |
| Data analysis or web development | 3–6 months |
| Job-ready / advanced topics | 6–12 months |
With 30 minutes of daily practice, most beginners learn the basics in about a month.
Absolutely. It was built for beginners. Its clean, simple syntax makes it the #1 recommended first language. Thousands of self-taught developers started right here.
Python 2 was officially discontinued on January 1, 2020. Always learn and use Python 3. All examples in this series use Python 3.
| Tool | Best For |
|---|---|
| VS Code (free) | General development — most popular choice |
| PyCharm (free/paid) | Professional Python projects |
| IDLE (built-in) | Absolute beginners — comes pre-installed |
| Jupyter Notebook | Data science and experimentation |
| Thonny | Complete beginners learning programming |
Start with VS Code or IDLE — both are excellent choices.
You can build almost anything with it:
- Web applications (Django, Flask)
- Data analysis & visualization (Pandas, Matplotlib)
- Machine Learning & AI (TensorFlow, PyTorch)
- Automation scripts (web scraping, file management)
- Game development (Pygame)
- Desktop applications (Tkinter, PyQt)
We start from the basics and go up to advanced topics:
- Episodes 1–5: Fundamentals (variables, data types, loops, functions)
- Episodes 6–10: Data structures & file handling
- Episodes 11–15: OOP, modules, error handling
- Episodes 16+: Advanced topics and real-world projects
Did you find this helpful? Share it with someone learning to code!
Have questions? Drop them in the comments below.
Python tutorial Python for beginners Learn Python Python programming basics coding for beginners
Comments
Post a Comment