PYTHON VERY SHORT NOTES
UNIT 1:
- Python: High-level, interpreted language
- Data Types: int, float, bool, str, list
- Variables: No declaration needed
- Operators: +, -, *, /, %, ==, !=, >, <
- Expressions: combination of variables & operators
- Statements: instructions (if, print, assignment)
- Functions: reusable code blocks
- Modules: .py files (import module)
UNIT 2:
- Boolean: True / False
- if: decision making
- if-else: two conditions
- if-elif-else: multiple conditions
- Loops: while, for
- break: exit loop
- continue: skip iteration
- pass: empty statement
UNIT 3:
- Functions: def keyword
- Return: gives output
- Parameters vs Arguments
- Types: with/without return & parameters
- Scope: Local & Global
- Recursion: function calls itself
- Strings: immutable
- Arrays: collection of elements
UNIT 4:
- List: ordered, mutable
- Tuple: ordered, immutable
- Dictionary: key-value pairs
- List comprehension: short syntax
UNIT 5:
- Files: read/write data
- Exceptions: error handling
- try-except: handle errors
- Modules: datetime, math, os
- Packages: collection of modules