GateXAIMLPython for GATE DA
  • Chapter 1: Python Basics
    • Language Overview
      • Python Characteristics
        • Interpreted Language
        • Dynamically Typed
        • Strongly Typed
        • Everything is an Object
        • Indentation Defines Blocks
        • CPython: Reference Implementation & Execution Model
      • Running Python
        • Interactive Mode (REPL)
        • Script Mode and __name__
    • Variables & Assignment
      • Naming Rules
        • Identifier Rules
      • Assignment Mechanics
        • Variable as Name Binding
        • Object Identity vs Equality
    • Data Types
      • Numeric Types
        • int --- Arbitrary-Precision Integer
        • float --- IEEE 754 Double Precision
        • complex --- Complex Numbers
        • bool --- Boolean Type
      • NoneType
      • Type Conversion
    • Operators
      • Arithmetic Operators
        • All Arithmetic Operators
      • Comparison Operators
        • Comparison and Chaining
      • Logical Operators
        • Short-Circuit Evaluation
      • Bitwise Operators
        • Bit-Level Operations
      • Identity & Membership Operators
        • is, in and their Negations
      • Operator Precedence
        • Full Precedence Table
  • Chapter 2: Built-in Data Structures
    • Strings
      • String Properties
        • Immutable Unicode Sequence
      • String Literals
        • Quoting Styles and Escape Sequences
      • Slicing
        • The s[start:stop:step] Syntax
      • Key String Methods
        • Searching & Testing
        • Modification Methods (Return New String)
        • Splitting & Joining
        • String Formatting
        • Performance and Common Patterns
    • Lists
      • List Properties
        • Core Characteristics
      • List Creation
        • All Creation Methods
      • Indexing & Slicing
        • List Indexing, Slice Assignment and del
      • List Methods
        • Mutation Methods (In-Place)
        • Non-Mutating Methods
      • Copying Semantics
        • Assignment, Shallow Copy, Deep Copy
      • append vs extend vs + vs +=
        • Adding Elements and Combining Lists
    • Tuples
      • Tuple Properties
        • Core Characteristics
      • Creation & Special Syntax
        • Literal Forms and the Comma Rule
      • Packing & Unpacking
        • All Unpacking Forms
      • Tuple Methods
        • count() and index()
        • Tuple vs List --- When to Use Which
    • Dictionaries
      • Dictionary Properties
        • Core Characteristics
      • Dictionary Creation
        • All Creation Methods
      • Access & Mutation
        • Reading, Writing, Deleting
      • Views & Iteration
        • Live Views: keys(), values(), items()
      • Nested Dictionaries
        • Access, Mutation, and the Sharing Trap
    • Sets & Frozensets
      • Properties
        • Core Characteristics
      • Set Creation
        • Literals and Constructors
      • Set Operations
        • Mathematical Set Operators
        • Mutation Methods
        • Frozenset Details and Practical Set Patterns
        • Collection Types --- At a Glance
  • Chapter 3: Control Flow
    • Conditional Statements
      • if / elif / else
        • Syntax, Chaining and Nesting
      • Ternary (Conditional) Expression
        • Inline if-else
      • Truthy / Falsy Values
        • Python's Boolean Context
    • Loops
      • for Loop
        • Iterating Iterables, range, enumerate, zip
      • while Loop
        • Condition-Controlled Repetition
      • Loop Control
        • break, continue, pass
      • else Clause on Loops
        • Loop--else: The ``No Break'' Reward
      • Walrus Operator :=
  • Chapter 4: Functions
    • Defining & Calling Functions
      • Basic Syntax
        • def, return, docstrings
      • Function Objects
        • First-Class Functions
    • Arguments & Parameters
      • Positional and Keyword Arguments
        • Matching Rules
      • Default Parameters
        • Evaluated Once at Definition Time
      • Mutable Default Argument Trap
        • GATE Critical --- Shared Mutable Default
      • *args and **kwargs
        • Variable-Length Arguments
      • Argument Unpacking in Calls
        • * and ** at the Call Site
    • Pass-by-Object-Reference
      • How Python Passes Arguments
    • Scope --- LEGB Rule
      • The Four Scopes
        • LEGB Lookup Order
      • global Keyword
        • Accessing and Modifying Module-Level Names
      • nonlocal Keyword
        • Rebinding in Enclosing Scope (Closures)
        • global vs nonlocal --- Quick Reference
    • Recursion
      • Mechanics
        • Call Stack, Base Case, Recursive Case
      • Tracing Recursive Calls
        • Call Trees, Node Count, Fibonacci
      • Return Value Aggregation
        • Accumulating Results Bottom-Up
      • Recursive vs Iterative Equivalence
        • Converting Recursion to Iteration
      • Memoisation
        • Caching with lru_cache and Manual Dicts
    • Lambda Functions
      • Anonymous Single-Expression Functions
    • Higher-Order Functions
      • map()
        • Applying a Function to Every Element
      • filter()
        • Selecting Elements by Predicate
      • functools.reduce()
        • Folding an Iterable to a Single Value
    • Closures & Nested Functions
      • What is a Closure?
        • Definition and __closure__ Cells
      • Independent Closure Instances
        • Each Outer Call Creates a New Environment
      • Shared Mutable State Within One Closure
        • Multiple Inner Functions, One Shared Cell
      • Late Binding in Closures
        • The Loop Closure Bug
        • Closure vs Class --- When to Use Which
    • Decorators
      • Concept
        • What a Decorator Is
      • Writing a Decorator
        • Wrapper Pattern and functools.wraps
      • Stacking Decorators
        • Bottom-Up Application Order
      • Decorator with Arguments
        • Three-Level Nesting: Factory $\to$ Decorator $\to$ Wrapper
      • Common Built-in Decorators
        • functools.lru_cache, cached_property
  • Chapter 5: Comprehensions & Generators
    • List Comprehensions
      • Syntax, Multiple for Clauses, Nesting
    • Dictionary Comprehensions
      • Key-Value Mapping Expressions
    • Set Comprehensions
      • Unique-Element Expressions
    • Generator Expressions
      • Lazy Iterators from Expressions
    • Generator Functions
      • yield Statement
      • Suspending and Resuming Execution
  • Chapter 6: Object-Oriented Programming
    • Classes & Objects
      • Class Definition
      • What is a Class?
      • __init__ and self
        • Setting Up an Object
      • Class Variables vs Instance Variables
        • Shared vs Per-Object Data
    • Dunder (Magic) Methods
      • String Representation: __str__ and __repr__
    • Inheritance
      • Single Inheritance
        • Child Getting Everything from Parent
      • Hierarchical Inheritance
      • Method Overriding
      • Multilevel Inheritance
      • Multiple Inheritance and MRO
        • Getting from Two Parents, Diamond Problem
    • Polymorphism
    • Encapsulation & Name Mangling
      • Hiding Data Inside a Class
    • Abstract Base Classes
      • Forcing Child Classes to Implement Methods
GateXAIML · Python Concept Notes

Python for GATE Data Science & AI

Chapter 1
Python Basics
38 sections
Language Overview, Variables & Assignment, Data Types...
Chapter 2
Built-in Data Structures
58 sections
Strings, Lists, Tuples...
Chapter 3
Control Flow
17 sections
Conditional Statements, Loops
Chapter 4
Functions
67 sections
Defining & Calling Functions, Arguments & Parameters, Pass-by-Object-Reference...
Chapter 5
Comprehensions & Generators
11 sections
List Comprehensions, Dictionary Comprehensions, Set Comprehensions...
Chapter 6
Object-Oriented Programming
22 sections
Classes & Objects, Dunder (Magic) Methods, Inheritance...
GateXAIML · Python for GATE DA — Concept Notes
Home | About Us | Contact Us | Privacy Policy | Disclaimer
© 2026 GateXAIML. All original content. Not affiliated with IIT / GATE authorities.