Python Variables and Data Types - Detailed Notes
Variable: A variable is a named memory location used to store data. Example: x = 10
Rules for Variable Naming: Start with letter or underscore, cannot start with digit, keywords not
allowed, case-sensitive.
Dynamic Typing: Python automatically determines the data type at runtime.
Local vs Global Variables and Variable Scope.
Data Types: int, float, complex, bool, str, list, tuple, dict, set.
List vs Tuple: List is mutable, Tuple is immutable.
Mutable Types: list, dict, set. Immutable Types: int, float, str, tuple.
Deep Questions: Dynamic typing, memory management, == vs is, dictionaries and hash tables,
tuple performance, string immutability.
This PDF is a compact study version of the detailed notes.