Annexure 1: Glossary of Terms Used in Python Programming Language
Core Concepts:
- Variable: A named storage location that holds data (like numbers, text, or objects).
- Data Type: The kind of data a variable can store (e.g., integer, float, string, boolean).
- Object: A fundamental unit in Python, representing a combination of data and associated actions (methods).
- Function: A reusable block of code that performs a specific task.
- Method: A function that is associated with an object.
- Class: A blueprint for creating objects, defining their attributes and methods.
- Instance: A specific object created from a class.
- Attribute: A value associated with an object, referenced by name using dotted expressions.
- Indentation: Python uses indentation (spaces or tabs) to define code blocks, which is crucial for code structure and readability.
- Comment: Text within the code that is ignored by the interpreter, used for documentation and explanation.
- Interpreter: The program that executes Python code line by line.
- Module: A file containing Python code (functions, classes, etc.) that can be imported and used in other programs.
- Package: A collection of modules organized into a directory structure.
- Dynamic Typing: Python is dynamically typed, meaning the type of a variable is determined at runtime, not when it's declared.
- Garbage Collection: Python automatically manages memory by reclaiming memory occupied by unused objects.
Keywords:
True
/False
: Boolean values representing truth and falseness.None
: Represents the absence of a value.and
/or
/not
: Logical operators.as
: Used inimport
statements to give a module a different name.assert
: Used to check if a condition is true and raise an error if it's not.async
/await
: Used for asynchronous programming.break
: Exits a loop
class
: Used to define a class.continue
: Skips the current iteration of a loop and proceeds to the next.def
: Used to define a function.del
: Used to delete an object or variable.elif
: Short for "else if", used in conditional statements.else
: Used in conditional statements to execute code if the condition is false.except
: Used intry...except
blocks to handle exceptions.finally
: Used intry...except
blocks to execute code regardless of whether an exception occurred.for
: Used to create afor
loop.from
: Used inimport
statements to import specific elements from a module.global
: Used to access and modify global variables from within a function.if
: Used to create conditional statements.import
: Used to import modules.in
: Used to check if an element is in a sequence.is
: Used to check if two objects are the same object (same memory location).lambda
: Used to create small, anonymous functions.nonlocal
: Used to access and modify variables in the nearest enclosing function's scope.pass
: A placeholder statement that does nothing.
Alphabetical List
A
- Argument: A value passed to a function when calling it.
- Array: A collection of elements, similar to a list, but optimized for numerical operations.
- Assignment: The process of storing a value in a variable using
=
. - Attribute: A characteristic or property of an object, accessed using dot notation (
object.attribute
).
B
- Boolean: A data type representing
True
orFalse
. - Break Statement: Used to exit a loop before its normal termination.
- Bytecode: A low-level set of instructions executed by the Python interpreter.
C
- Class: A blueprint for creating objects in object-oriented programming.
- Comment: A line ignored by the interpreter, used for documentation (
# This is a comment
). - Compiler: Translates Python code into bytecode for execution.
- Conditional Statement: A statement that executes different code based on conditions (
if
,elif
,else
). - Constructor: A special method (
__init__
) used to initialize a class object.
D
- Data Type: Defines the type of data a variable holds (
int
,float
,str
, etc.). - Decorator: A function that modifies another function’s behavior (
@staticmethod
,@classmethod
). - Dictionary: A collection of key-value pairs (
dict
). - Docstring: A string used for documentation, enclosed in triple quotes (
"""docstring"""
).
E
- Exception: An error that occurs during execution, handled using
try
andexcept
. - Expression: A combination of values, variables, and operators that evaluate to a result.
F
- Float: A data type representing decimal numbers.
- For Loop: A loop that iterates over a sequence (e.g., list, tuple, range).
- Function: A reusable block of code defined using
def
.
G
- Garbage Collection: Automatic memory management in Python.
- Generator: A function that yields values lazily using
yield
. - Global Variable: A variable declared outside a function and accessible throughout the script.
H
- Hashable: An object with a fixed hash value, usable as dictionary keys.
I
- Identifier: The name of a variable, function, or class.
- Immutable: An object whose value cannot be changed (
str
,tuple
). - Indentation: The use of spaces or tabs to define code blocks in Python.
- Indexing: Accessing elements of a sequence using their position (
list[0]
). - Iterable: An object capable of returning its elements one at a time.
J
- JSON (JavaScript Object Notation): A lightweight data format used for data exchange, supported in Python via
json
module.
K
- Keyword: A reserved word in Python (
if
,else
,while
,for
,def
, etc.).
L
- Lambda Function: An anonymous function defined using
lambda
. - List: A mutable sequence of elements.
- Loop: A structure used to repeat a block of code multiple times (
for
,while
).
M
- Method: A function defined inside a class.
- Module: A file containing Python code, imported using
import
. - Mutable: An object that can be modified after creation (
list
,dict
).
N
- Namespace: A mapping between variable names and objects.
- None: A special keyword representing the absence of a value.
O
- Object: An instance of a class.
- Operator: A symbol that performs an operation (
+
,-
,*
,/
). - Overloading: Defining multiple functions with the same name but different parameters.
P
- Package: A collection of Python modules.
- Parameter: A variable in a function definition.
- Pass Statement: A placeholder statement that does nothing (
pass
). - Polymorphism: A feature of OOP where different classes can have methods with the same name.
Q
- Queue: A data structure following FIFO (First In, First Out) principles.
R
- Recursion: A function that calls itself.
- Return Statement: Used in functions to return a value.
S
- Set: An unordered collection of unique elements.
- Slice: Extracting a portion of a sequence (
list[1:4]
). - String: A sequence of characters enclosed in quotes.
- Syntax: The rules defining the structure of Python code.
T
- Tuple: An immutable sequence of elements.
- Type Casting: Converting one data type into another (
int("10")
).
U
- Unicode: A standard for representing text characters.
V
- Variable: A named location in memory storing a value.
- Virtual Environment: A self-contained Python environment to manage dependencies.
W
- While Loop: A loop that executes as long as a condition remains true.
X
- XOR (Exclusive OR): A logical operation used in bitwise computations.
Y
- Yield: Used in generators to return values lazily.
Z
- Zip: A function that combines multiple iterables into tuples.
Expanded important glossaries in Python Programming Language :
Here are some expanded important glossaries in Python Programming Language that are commonly used in programming:
Alphabetical List
A
- Abstract Class: A class that cannot be instantiated directly and is meant to be a base for other classes. Defined using
ABC
module. - Assertion (
assert
): A debugging statement that checks if a condition isTrue
; otherwise, it raises an error.
B
- Bitwise Operators: Operators that perform operations at the bit level (
&
,|
,^
,<<
,>>
). - Buffer: A temporary storage area for data being transferred between two locations.
C
- Call Stack: A data structure that stores function calls in the order they are executed.
- Closure: A function object that retains access to variables from its enclosing scope even after the scope has finished execution.
D
- Dynamic Typing: Python's ability to assign a variable a different type at runtime.
- Duck Typing: A type system where the class of an object is determined by its behavior rather than inheritance.
E
- Encapsulation: A fundamental OOP concept that restricts direct access to some of an object’s components.
- Eval Function (
eval()
): A built-in function that evaluates a Python expression from a string.
F
- First-Class Function: Functions that can be assigned to variables, passed as arguments, and returned from other functions.
- Frozen Set (
frozenset
): An immutable version of a set.
G
- Global Interpreter Lock (GIL): A mutex that protects access to Python objects, preventing multiple threads from executing Python bytecode at once.
H
- Heap Memory: The portion of memory where dynamically allocated objects are stored.
- Higher-Order Function: A function that takes another function as an argument or returns a function.
I
- Introspection: The ability of a program to examine its own structure at runtime.
- Instance: An individual object created from a class.
J
- JIT Compilation: Just-In-Time compilation; a method of optimizing code execution by compiling parts of it at runtime.
K
- Keyword Arguments: Arguments passed to functions with explicit parameter names (
func(name="Alice")
).
L
- Lazy Evaluation: A strategy where expressions are only evaluated when needed (e.g., generators).
- List Comprehension: A concise way to create lists using a single line of code (
[x**2 for x in range(10)]
).
M
- Magic Methods (
__init__
,__str__
, etc.): Special methods in Python classes that define how objects behave. - Memory Management: Python handles memory allocation and deallocation using garbage collection.
N
- Named Tuple (
collections.namedtuple
): A tuple with named fields for better readability. - Namespace Collision: When two identifiers in the same scope have the same name.
O
- Object-Oriented Programming (OOP): A programming paradigm based on objects and classes.
- Operator Overloading: Defining custom behavior for operators (
+
,-
,*
, etc.) on user-defined classes.
P
- Pickling/Unpickling: The process of serializing (storing) and deserializing (loading) Python objects using the
pickle
module. - Property Decorator (
@property
): A way to define getter and setter methods for class attributes.
Q
- Queue (
queue.Queue
): A data structure that follows FIFO (First In, First Out).
R
- Reflection: The ability of a program to examine and modify its structure and behavior at runtime.
- Regular Expression (RegEx): A sequence of characters used for pattern matching in strings.
S
- Shallow Copy vs Deep Copy: A shallow copy copies object references, while a deep copy duplicates the object’s content.
- Singleton Pattern: A design pattern ensuring a class has only one instance.
T
- Threading vs Multiprocessing: Threading runs multiple tasks in the same process, while multiprocessing runs them in separate processes.
- Type Hinting: A way to specify variable types (
def func(x: int) -> str:
).
U
- Unpacking (
*args
,**kwargs
): Expanding iterable elements into function arguments.
V
- Virtual Machine (Python VM): The component that executes Python bytecode.
W
- Weak Reference (
weakref
): A reference to an object that does not increase its reference count, useful for memory management.
X
- XML Parsing: Extracting and processing data from XML documents.
Y
- Yield vs Return:
yield
pauses the function and retains its state, whereasreturn
exits the function and returns a value.
Z
- Zip Function (
zip()
): Combines multiple iterables into tuples.
Comments
Post a Comment
"Thank you for seeking advice on your career journey! Our team is dedicated to providing personalized guidance on education and success. Please share your specific questions or concerns, and we'll assist you in navigating the path to a fulfilling and successful career."