Variables &
Data Types

Integers

  • int - Whole numbers with no decimal places

Floats

  • float - Floating-point numbers

Booleans

  • bool - Boolean values (True or False)

Strings

  • str - Sequence of Unicode characters

Lists

  • list - Mutable sequence of items

Tuples

  • tuple - Immutable sequence of items

Dictionaries

  • dict - Unordered collection of key-value pairs

Sets

  • set - Unordered collection of unique items

  • frozenset - Immutable set

Object-Oriented
Programming

class: Defining a class

Polymorphism

__call__(): Calling an object

Functional
Programming

Lambda Functions

Map, Filter, Reduce

List Comprehensions, Dict Comprehensions

Operators & Control

flow

Operators

Arithmetic Operators

Comparison Operators

Logical Operators

Bitwise Operators

Control Flow

Conditional Statements

Loops

Control Flow Statements

Encapsulation

__getattr__(), __setattr__(), __delattr__(): Attribute access

Exception
Handling

try: Attempting a block of code

raise: Raising an exception

class: Defining a custom exception

DSA

Arrays and Linked Lists

List Documentation

List Methods

Linked Lists in Python

Stacks and Queues

Stacks in Python

Queues in Python

Stack and Queue Operations

Trees and Graphs

Trees in Python

Graphs in Python

Graph Traversal Algorithms

Sorting Algorithms

Sorting in Python

Searching Algorithms

Linear Search in Python

Binary Search in Python

Functions

Defining and Calling Functions

Parameters and Arguments

Return Statements

  • return - Returning values from a function

Scope (Local, Global, Nonlocal)

File I/O

Reading and Writing Files

File Modes

  • 'r' - Reading mode

  • 'w' - Writing mode

  • 'a' - Appending mode

  • 'x' - Exclusive creation mode

  • 'b' - Binary mode

  • 't' - Text mode (default)

Handling File Exceptions

  • try - Catching exceptions

  • except - Handling specific exceptions

  • finally - Executing cleanup code

Inheritance

class: Defining a derived class

Abstraction

abc.ABC, abc.abstractmethod(): Abstract base classes

Decorators

Function Decorators

Class Decorators