Skip to content

Python Glossary for Beginners

Plain-English definitions of the Python words you meet in this course. Each term links to the lesson that teaches it. Use the search box at the top to jump to a term fast.

Core building blocks

Variable

A name that points to a value, created with = (for example age = 30). See Variables and Data Types.

Data type

The kind of value something is: text (str), whole number (int), decimal (float), or true/false (bool). See Variables and Data Types.

String (str)

Text, written inside quotes, like "hello". See Strings and f-strings.

f-string

A string with an f in front that lets you drop values straight into the text, like f"Hi {name}". See Strings and f-strings.

Integer (int)

A whole number with no decimal point, like 42. See Variables and Data Types.

Float

A number with a decimal point, like 3.14. See Variables and Data Types.

Boolean (bool)

A value that is either True or False. See Operators, Booleans and Conditionals.

None

A special value that means "nothing here yet". See Operators, Booleans and Conditionals.

Comment

A note in your code that Python ignores, starting with #. It is for humans, not the computer. See Variables and Data Types.

Keyword

A word Python reserves for itself (like if, for, def, True) that you cannot use as a name. See Variables and Data Types.

Working with data

Operator

A symbol that does something to values: arithmetic (+ - * /), comparison (== > <), or logic (and or not). See Operators, Booleans and Conditionals.

List

An ordered, changeable collection written in square brackets, like [1, 2, 3]. See Collections.

Tuple

An ordered collection that cannot be changed, written in round brackets, like (1, 2). See Collections.

Dictionary (dict)

A collection of key: value pairs, like {"name": "Kalyan"}. See Collections.

Set

A collection of unique values with no order, written in curly braces, like {1, 2, 3}. See Collections.

Index

The position of an item in a sequence, starting at 0. colors[0] is the first item. See Strings and f-strings.

Slice

A piece of a sequence taken with [start:stop], like text[0:3]. See Strings and f-strings.

Mutable / Immutable

Mutable means it can change in place (lists, dicts, sets); immutable means it cannot (numbers, strings, tuples). See Collections.

Control flow

Conditional (if / elif / else)

Code that runs only when a test is True. See Operators, Booleans and Conditionals.

Loop

Code that repeats: a for loop walks through a collection, a while loop repeats while a test is True. See Loops and Comprehensions.

break / continue

break stops a loop early; continue skips to the next round. See Loops and Comprehensions.

List comprehension

A short way to build a list in one line, like [n * 2 for n in nums]. See Loops and Comprehensions.

Functions and types

Function

A named block of code you define with def and run by calling its name. See Functions.

Parameter / Argument

A parameter is the name in a function definition; an argument is the value you pass when you call it. See Functions.

Return value

The value a function hands back with return. See Functions.

args and kwargs

*args collects extra positional values; **kwargs collects extra named values. See Functions.

Lambda

A tiny one-line function with no name, like lambda x: x * 2. See Functions.

Module / import

A module is a .py file of ready-made tools; import brings it in. See Functions.

Scope

Where a name can be seen: a variable made inside a function lives only there. See Functions.

Type hint

An optional label that says what type a value should be, like name: str. See Type Hints.

Errors and objects

Exception / Error

A problem Python raises while running, like ValueError or ZeroDivisionError. See Error Handling and Debugging.

try / except

A block that runs risky code and catches the error so the program keeps going. See Error Handling and Debugging.

raise

Signal an error on purpose when the input is wrong. See Error Handling and Debugging.

Traceback

The error report Python prints when something crashes; read it from the bottom up. See Error Handling and Debugging.

Syntax error

Code written wrong, so Python will not run it at all (a missing : or )). See Error Handling and Debugging.

Class / Object

A class is a blueprint; an object (instance) is a thing built from it. See Classes and OOP Basics.

Method

A function that belongs to an object, called with a dot, like text.upper(). See Classes and OOP Basics.

Attribute

A piece of data stored on an object, read with a dot, like book.title. See Classes and OOP Basics.

dataclass

A shortcut decorator that writes a class's __init__ and a clean display for you. See Classes and OOP Basics.

Tools and environment

REPL

The interactive Python shell where you type one line and see the result right away. See Python Environment Setup.

IDE / VS Code

The editor you write and run your code in. See Python Environment Setup.

JSON

A text format for saving and sharing data, very close to Python dicts and lists. See Files, JSON and Paths.

Standard library

The batteries-included modules that ship with Python, like math, random, and datetime. See Standard Library Essentials.