Approx. read time: 2.5 min.

Post: Python Glossary

Python Glossary

A programming glossary for Python for the beginner. If you want a more in-depth glossary, visit the Official Python Documentation.

Class

Python is a Language that supports the Object Oriented Programming paradigm. Like other OOP languages, Python has classes which are defined wireframes of objects. Python supports class inheritance. A class may have many subclasses but may only inherit directly from one superclass.

Syntax

Copy to Clipboard

Example

Copy to Clipboard

Comments

SINGLE-LINE COMMENTS

Copy to Clipboard

MULTI-LINE COMMENTS

Copy to Clipboard

Dictionaries

Syntax

Copy to Clipboard

Example

Copy to Clipboard

Syntax

Copy to Clipboard

Example

Copy to Clipboard

Functions

Syntax

Copy to Clipboard

Example

Copy to Clipboard

Syntax

Copy to Clipboard

Example

Copy to Clipboard

Function Objects

Example

Copy to Clipboard

len()

Syntax

Copy to Clipboard

Example

Copy to Clipboard

List Comprehensions

Syntax

Copy to Clipboard

Example

Copy to Clipboard

Lists

Example

Copy to Clipboard

Loops

FOR LOOPS

Example

Copy to Clipboard

WHILE LOOPS

Example

Copy to Clipboard

print()

Example

Copy to Clipboard

range()

Syntax

Copy to Clipboard

Example

Copy to Clipboard

Sets

Example

Copy to Clipboard

Slice

Example

Copy to Clipboard

str()

Example

Copy to Clipboard

Strings

Example

Copy to Clipboard

Tuples

Example

Copy to Clipboard

TUPLE ASSIGNMENT

Example

Copy to Clipboard

Variables

Example

Copy to Clipboard

Python Glossary

1. Python

Python is a high-level, interpreted programming language known for its simplicity and readability.

print("Hello, world!")

2. Variable

A variable is a name that refers to a value stored in memory.

x = 5

3. String

A string is a sequence of characters enclosed in single or double quotes.

message = "Hello, world!"

4. Integer

An integer is a whole number without a decimal point.

age = 30

5. Float

A float is a number with a decimal point.

pi = 3.14

6. List

A list is a collection of items, which can be of different types, enclosed in square brackets and separated by commas.

numbers = [1, 2, 3, 4, 5]

7. Tuple

A tuple is an immutable collection of items, enclosed in parentheses and separated by commas.

coordinates = (10, 20)

8. Dictionary

A dictionary is a collection of key-value pairs, enclosed in curly braces and separated by commas.

person = {'name': 'John', 'age': 30}

9. Function

A function is a block of reusable code that performs a specific task.

def greet(name):
    print("Hello, " + name + "!")

10. Module

A module is a file containing Python code that can be imported and used in other Python programs.

import math

11. Loop

A loop is a control structure that repeats a block of code multiple times.

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

12. Conditional Statement

A conditional statement is a control structure that executes different code blocks based on whether a condition is true or false.

if x > 0:
    print("Positive")
else:
    print("Negative")

13. Class

A class is a blueprint for creating objects that have similar attributes and methods.

class Car:
    def __init__(self, make, model):
        self.make = make
        self.model = model

14. Object

An object is an instance of a class.

car = Car("Toyota", "Camry")

15. Exception

An exception is an error that occurs during the execution of a program.

try:
    result = 10 / 0
except ZeroDivisionError:
    print("Cannot divide by zero")

16. Method

A method is a function that belongs to an object.

class Dog:
    def bark(self):
        print("Woof!")

17. Attribute

An attribute is a value associated with an object.

dog = Dog()
dog.breed = "Labrador"

About the Author: Bernard Aybout (Virii8)

I am a dedicated technology enthusiast with over 45 years of life experience, passionate about computers, AI, emerging technologies, and their real-world impact. As the founder of my personal blog, MiltonMarketing.com, I explore how AI, health tech, engineering, finance, and other advanced fields leverage innovation—not as a replacement for human expertise, but as a tool to enhance it. My focus is on bridging the gap between cutting-edge technology and practical applications, ensuring ethical, responsible, and transformative use across industries. MiltonMarketing.com is more than just a tech blog—it's a growing platform for expert insights. We welcome qualified writers and industry professionals from IT, AI, healthcare, engineering, HVAC, automotive, finance, and beyond to contribute their knowledge. If you have expertise to share in how AI and technology shape industries while complementing human skills, join us in driving meaningful conversations about the future of innovation. 🚀