Complete Python Notes (Beginner to Intermediate)
-----------------------------------------------
1. Introduction to Python & Installation
Python is a high-level, interpreted programming language.
Purpose: web apps, AI/ML, scripting, data science.
Install from [Link], verify using python --version.
Example:
print("Hello Python")
2. Data Types
Integers, Floats, Booleans, Strings.
Examples:
a = 5 (int)
b = 3.14 (float)
flag = True (boolean)
name = 'Python' (string)
3. Lists
Ordered, mutable collections.
fruits = ['apple', 'banana', 'mango']
4. Variables
x = 10
5. Expressions
x=5+3*2
6. Statements
print(a)
7. Precedence of Operators
(), **, *, /, +, -
8. Comments
# single-line
''' multi-line '''
9. Modules
import math
from math import sqrt
10. Functions
Reusable code block.
def add(a, b): return a + b
11. Flow of Execution: top to bottom.
12. Parameters & Arguments
def greet(name): print(name)
13. Boolean Operators: and, or, not
14. Conditionals
if, if-else, if-elif-else
15. Loops
while, for, break, continue
16. Fruitful Functions (return)
return n*n
17. Local vs Global variables
18. Function Composition
Calling function inside another.