Python Bites: Glossary

Python keywords and terms

Generated with ChatGPT 4o
Term Definition
ArgumentA value passed to a function when it is called.
ClassA blueprint for creating user-defined objects with attributes and methods.
ComprehensionConcise syntax for creating sequences, e.g., list comprehensions: [x for x in range(5)].
DecoratorA function that modifies the behavior of another function or method using @ syntax.
DictionaryA collection of key-value pairs: {'key': 'value'}.
ExceptionAn error detected during execution that can be handled with try/except.
FunctionA block of reusable code defined using the def keyword.
GeneratorA function that uses yield to produce a sequence of values lazily.
ImmutableDescribes types that cannot be changed after creation (e.g., tuple, str, int).
ImportStatement used to bring modules and their functions into the current namespace.
IndentationWhitespace that defines block structure in Python code. It replaces curly braces used in other languages.
IterableAny object capable of returning its elements one at a time, e.g., lists, strings, files.
IteratorAn object representing a stream of data that implements the __next__() method.
LambdaAn anonymous function defined with the lambda keyword.
ListAn ordered, mutable sequence of items: [1, 2, 3].
ModuleA file containing Python definitions and statements, typically ending in .py.
ObjectAn instance of a class. Almost everything in Python is an object.
PackageA directory containing an __init__.py file and one or more modules.
ParameterA variable in a function definition that accepts a value when the function is called.
SetAn unordered collection of unique elements: {1, 2, 3}.
SliceA way to extract parts of sequences using [start:stop:step] syntax.
StringA sequence of Unicode characters: "hello" or 'hello'.
TupleAn immutable sequence of elements: (1, 2, 3).
VariableA name that refers to a value stored in memory.
Virtual EnvironmentAn isolated Python environment for managing dependencies separately from the global installation.
YieldA keyword used in generator functions to return a value and suspend function state.