Class12 CS Quick Summary
Class12 CS Quick Summary
PYTHON BASICS
- Python is an interpreted, high-level, dynamically typed language.
- Data Types: int, float, str, bool, list, tuple, dict, set
- Operators: Arithmetic (+, -, *, /), Relational (==, !=), Logical (and, or, not)
- Conditional Statements: if, elif, else
- Loops: for, while; Loop control: break, continue, pass
FUNCTIONS
- Syntax: def name(params): return result
- Return: Sends value back to caller
- Default Params: def greet(name="User")
- Recursion: Function calling itself with base condition
- Lambda: Anonymous function, e.g., lambda x: x*x
- Scope: Local vs Global variables