Python · Plain-English Glossary
Python Programming Glossary — Key Words Explained Simply
Quick summary — Python key words explained simply
This is a plain-English Python glossary — one short definition per term, with a runnable example. If a tutorial, a job interview or a StackOverflow answer used a word you did not fully understand, it is probably in here.
In this glossary you will find:
- Basics — variable, type, list, tuple, dict, set, string.
- Flow & functions — if, for, while, def, return, args, kwargs, lambda.
- Classes & errors — class, self, __init__, inheritance, try, except.
- Mini cheat-sheet — copy-paste snippets you can run.
- Practice hints — what to try after reading each term.
SECTION 01Basics & data types
These are the terms you see in your first ten minutes of Python. Each one is defined in plain English, followed by a one-line example:
| Term | Plain-English meaning | Example |
|---|---|---|
| Variable | A name that stores a value | x = 10 |
| Type | What kind of value it is | type(10) → int |
| int / float | Whole number / decimal number | 3, 3.14 |
| str | Text in quotes | "hello" |
| bool | True or False | True, False |
| list | Ordered, changeable collection | [1, 2, 3] |
| tuple | Ordered, unchangeable collection | (1, 2, 3) |
| dict | Key → value pairs | {"a": 1, "b": 2} |
| set | Unordered, unique items | {1, 2, 3} |
| None | Means "nothing here yet" | x = None |
# The five types you will use every day
name = "Ankit" # str
age = 28 # int
score = 91.5 # float
is_active = True # bool
skills = ["python", "sql"] # list
# The two collection types you will also use a lot
location = {"city": "Delhi", "pin": "110092"} # dict
unique_ids = {101, 102, 103} # set
# None means "no value yet"
selected = None
# Check a type
type(age) # <class 'int'>
type(score) # <class 'float'>
isinstance(age, int) # True
# Convert between types
int("42") # 42
str(42) # "42"
float(3) # 3.0
list("abc") # ['a', 'b', 'c']
# Strings vs numbers
"5" + "5" # "55" (concatenation)
5 + 5 # 10 (addition)
int("5") + 5 # 10
TypeError, print type(...) for both
variables before you guess.
SECTION 02Flow control & functions
These words control which lines run, and how many times:
| Term | Plain-English meaning | Example |
|---|---|---|
| if / elif / else | Run code only when a condition is true | if x > 0: |
| for | Repeat for every item in a sequence | for n in [1,2,3]: |
| while | Repeat while a condition is true | while x < 10: |
| break | Exit the loop immediately | break |
| continue | Skip to the next iteration | continue |
| def | Define a reusable block of code | def greet(): |
| return | Send a value back to the caller | return x + 1 |
| parameter / argument | The input a function expects / the value you pass | def add(a, b): |
| *args / **kwargs | Accept many extra positional / keyword arguments | def f(*a, **k): |
| lambda | A tiny one-line anonymous function | lambda x: x*2 |
# if / elif / else
score = 82
if score >= 90:
grade = "A"
elif score >= 75:
grade = "B"
else:
grade = "C"
print(grade) # B
# for loop
for n in [1, 2, 3, 4, 5]:
if n == 3:
continue # skip 3
if n == 5:
break # stop at 5
print(n) # 1, 2, 4
# while loop
count = 0
while count < 3:
print("tick", count)
count += 1
# A plain function
def add(a, b):
return a + b
print(add(2, 3)) # 5
# Default arguments
def greet(name, msg="Hello"):
return f"{msg}, {name}!"
print(greet("Ankit")) # Hello, Ankit!
print(greet("Ankit", "Hi")) # Hi, Ankit!
# *args and **kwargs
def total(*nums, **options):
print(nums) # (1, 2, 3)
print(options) # {'currency': 'INR'}
return sum(nums)
total(1, 2, 3, currency="INR")
# lambda — a tiny function
double = lambda x: x * 2
print(double(5)) # 10
return instead.
SECTION 03Classes, objects & errors
These are the words that confuse beginners the most, so they are explained in one line each:
| Term | Plain-English meaning | Example |
|---|---|---|
| class | A blueprint for making objects | class Dog: |
| object / instance | A real thing made from a class | d = Dog() |
| __init__ | Runs automatically when you create the object | def __init__(self): |
| self | Refers to the current object | self.name = name |
| attribute | A value stored inside an object | d.name |
| method | A function attached to an object | d.bark() |
| inheritance | A class that reuses another class | class Puppy(Dog): |
| try / except | Handle errors instead of crashing | try: ... except: |
| raise | Deliberately trigger an error | raise ValueError("bad") |
| Exception | The base type of most runtime errors | except Exception as e: |
class Dog:
def __init__(self, name, age):
self.name = name # attribute
self.age = age # attribute
def bark(self): # method
return f"{self.name} says woof"
d = Dog("Rex", 3) # instance
print(d.bark()) # Rex says woof
print(d.name) # Rex
# Inheritance
class Puppy(Dog):
def bark(self):
return f"{self.name} says yip"
p = Puppy("Milo", 1)
print(p.bark()) # Milo says yip
# Handle a common error
try:
value = int("abc")
except ValueError:
value = 0
print(value) # 0
# Raise your own
def set_age(age):
if age < 0:
raise ValueError("age cannot be negative")
return age
try:
set_age(-1)
except ValueError as e:
print("Caught:", e)
# finally always runs
try:
print("working")
finally:
print("cleanup")
SECTION 04Mini cheat-sheet
Copy this section into a scratch file — it covers the 90% of Python you will write in your first month:
# Variables and types
x = 10
name = "Ankit"
flag = True
# Lists, dicts, sets
nums = [1, 2, 3]
info = {"name": "Ankit", "age": 28}
unique = {1, 2, 2, 3} # {1, 2, 3}
# Conditionals
if x > 5:
print("big")
else:
print("small")
# Loops
for n in nums:
print(n)
# Functions
def add(a, b=0):
return a + b
# Classes
class Point:
def __init__(self, x, y):
self.x = x
self.y = y
# Errors
try:
result = 1 / 0
except ZeroDivisionError:
result = None
# Comprehensions
squares = [n*n for n in range(5)] # [0,1,4,9,16]
# F-strings
print(f"{name} is {28} years old")
Glossary terms to master before your first project:
Basics
☐ variable ☐ type ☐ int / float
☐ str ☐ bool ☐ None
☐ list ☐ tuple ☐ dict
☐ set
Flow
☐ if / elif / else
☐ for ☐ while
☐ break ☐ continue
☐ range()
Functions
☐ def ☐ return
☐ parameter ☐ argument
☐ *args ☐ **kwargs
☐ lambda
Classes
☐ class ☐ object
☐ __init__ ☐ self
☐ attribute ☐ method
☐ inheritance
Errors
☐ try / except
☐ raise
☐ Exception
Comprehensions
☐ list comprehension
☐ dict comprehension
Tick each one once you have written code using it.
SECTION 05How to practise the glossary
Reading a glossary once will not make you fluent. Here are six ways to turn these words into actual skill:
- Write one example per term — a 3-line script is enough. The act of typing it beats reading it.
- Rewrite your own code using each word — replace a loop with a comprehension, a dict with a class, a print with a return.
-
Read error messages out loud —
TypeError,KeyError,IndexErrorandValueErrortell you exactly which glossary term is broken. - Keep a personal glossary file — every time you see a new word, add one line and one example. Your file is worth more than this page.
-
Explain it to someone else — if you cannot explain
selfin one sentence, you do not yet understandself. - Build something tiny every week — a CLI calculator, a CSV cleaner, a text file parser. Real use locks the words in.
SECTION 06Python Q&A — glossary questions
Q1What is the difference between a list and a tuple?
A list can change (you can add or remove items); a tuple cannot. Use a tuple when the data is fixed — like coordinates or a record that should not be edited by mistake.
Q2What is self actually
doing?
self is the object currently being worked on. When
you call d.bark(), Python automatically passes
d as self inside the method.
Q3When should I use a lambda?
Only for very small one-line functions, usually inside
sorted(), map() or
filter(). If it needs a name, a docstring, or more
than one line, use def.
Q4What is a comprehension?
A short way to build a list, dict or set from an existing
sequence. [n*n for n in range(5)] creates
[0, 1, 4, 9, 16] in one line.
Q5Why do I keep getting
TypeError?
Usually because you are mixing types — adding a string to a
number, or passing the wrong number of arguments to a function.
Print type(...) for each value before the error
line.
SECTION 07Test yourself — Python glossary quiz
Five questions. No sign-up.
0 / 5Pick an answer to see why it is right or wrong.
SECTION 08Frequently asked questions
What is the difference between a parameter and an argument?
A parameter is the name in the function definition —
def add(a, b). An argument is the actual value you
pass when calling it — add(2, 3).
What does *args actually do?
It collects any extra positional arguments into a tuple, so the
function can accept any number of inputs. **kwargs
does the same for keyword arguments, as a dictionary.
What is the difference between == and is?
== checks if two values are equal.
is checks if they are the same object in memory. Use
is almost only for None.
Why does "5" + 5 fail?
Because one is a string and one is an integer — Python refuses to
guess your intent. Convert first: int("5") + 5.
Do I need to learn classes to write useful Python?
Not immediately — functions and dicts cover a lot. But you will
need classes as soon as you use libraries like Django, SQLAlchemy
or even basic dataclasses.
SECTION 09Related reads
Classroom & online · Delhi NCR
Learn Python the way it is actually used
Our Python Training Course takes you from these glossary terms to real scripts, projects and interview-ready code — with live classes and mentor reviews.
₹15,500 onwards- Core Python & OOP
- Real projects, not toy snippets
- Interview-style exercises
- Weekday & weekend batches