Python Tutorial for Beginners (Episode 1)

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

  1. Visit the official website: python.org
  2. Hover over Downloads and click the latest Python version for your operating system
  3. Choose the correct installer (Windows / macOS / Linux)

Step 2: Run the Installer

  • Windows: Run the .exe file — check the box "Add Python to PATH" at the bottom, then click "Install Now"
  • macOS: Run the .pkg file and follow the on-screen instructions
  • Linux: Python usually comes pre-installed. Run python3 --version in your terminal to verify
Pro Tip: Checking "Add Python to PATH" on Windows saves you from "command not found" errors later.

Step 3: Verify Installation

Open your terminal (Command Prompt / PowerShell / Terminal) and type:

python --version

You should see output like:

Python 3.13.x

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

  1. Save the file as hello.py
  2. Open your terminal in that folder
  3. Run the command:
python hello.py

You'll see:

Hello, World!

You just wrote and executed your first program! Here's what happened:

PartMeaning
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-sensitivename, Name, and NAME are all different
  • Cannot use reserved keywords like if, else, while, class

my_var   playerScore   _count   user2

2pac   my-var   class

Common Data Types

TypeExampleDescription
int42, -10, 0Whole numbers
float3.14, -0.5, 2.0Decimal numbers
str"Hello", 'Python'Text (single or double quotes)
boolTrue, FalseLogical values
NoneTypeNoneRepresents "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:

What is your name? John
Hello, John!
Note: 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 name: Priya
Enter your age: 25
Hello Priya!
You were born in 2001.
You will turn 100 in the year 2101.
Quick Explanation: 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)

MistakeWrong CodeFix
Missing quotesprint(Hello)print("Hello")
Missing parenthesesprint "Hello"print("Hello")
Case-sensitive errorPrint("Hello")print("Hello")
Using undefined variableprint(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)

How to check the version?

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)
How long does it take to learn?

It depends on your goals and consistency:

GoalTypical Time
Basics (variables, loops, functions)2–4 weeks
Build small projects independently1–3 months
Data analysis or web development3–6 months
Job-ready / advanced topics6–12 months

With 30 minutes of daily practice, most beginners learn the basics in about a month.

Can I learn without coding experience?

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.

What's the difference between Python 2 and Python 3?

Python 2 was officially discontinued on January 1, 2020. Always learn and use Python 3. All examples in this series use Python 3.

Which IDE should I use?
ToolBest For
VS Code (free)General development — most popular choice
PyCharm (free/paid)Professional Python projects
IDLE (built-in)Absolute beginners — comes pre-installed
Jupyter NotebookData science and experimentation
ThonnyComplete beginners learning programming

Start with VS Code or IDLE — both are excellent choices.

What can I build with it?

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)
How is this series structured?

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