Python Handwritten-Style Notes
1. Introduction to Python
Python is a high-level, interpreted programming language known for its
simplicity and readability.
It supports multiple programming paradigms and is widely used in web
development, data analysis, AI, and more.
Example:
print("Welcome to Python!")
2. Variables & Data Types
Python is dynamically typed. Common data types: int, float, str, bool.
Example:
a = 10 # int
b = 3.14 # float
name = "Ali" # str
flag = True # bool
3. Input & Output
Input is taken using input(), output using print().
Example:
name = input("Enter your name: ")
print("Hello", name)
4. Operators
Types: Arithmetic (+, -, *, /), Assignment (=, +=), Comparison (==, !=),
Logical (and, or), Bitwise (&, |)
Example:
a = 5; b = 2
print(a + b, a > b, a & b)
5. Conditional Statements
if, elif, else are used to make decisions.
, Python Handwritten-Style Notes
Example:
age = 18
if age >= 18:
print("Adult")
else:
print("Minor")
6. Loops
Used for repetition.
for loop:
for i in range(5):
print(i)
while loop:
i = 0
while i < 5:
print(i)
i += 1
7. Strings
Strings are sequences of characters.
Example:
text = "Hello"
print(text.upper(), text[0], len(text))
8. Functions
Defined using def keyword.
Example:
def greet(name):
return "Hello " + name
1. Introduction to Python
Python is a high-level, interpreted programming language known for its
simplicity and readability.
It supports multiple programming paradigms and is widely used in web
development, data analysis, AI, and more.
Example:
print("Welcome to Python!")
2. Variables & Data Types
Python is dynamically typed. Common data types: int, float, str, bool.
Example:
a = 10 # int
b = 3.14 # float
name = "Ali" # str
flag = True # bool
3. Input & Output
Input is taken using input(), output using print().
Example:
name = input("Enter your name: ")
print("Hello", name)
4. Operators
Types: Arithmetic (+, -, *, /), Assignment (=, +=), Comparison (==, !=),
Logical (and, or), Bitwise (&, |)
Example:
a = 5; b = 2
print(a + b, a > b, a & b)
5. Conditional Statements
if, elif, else are used to make decisions.
, Python Handwritten-Style Notes
Example:
age = 18
if age >= 18:
print("Adult")
else:
print("Minor")
6. Loops
Used for repetition.
for loop:
for i in range(5):
print(i)
while loop:
i = 0
while i < 5:
print(i)
i += 1
7. Strings
Strings are sequences of characters.
Example:
text = "Hello"
print(text.upper(), text[0], len(text))
8. Functions
Defined using def keyword.
Example:
def greet(name):
return "Hello " + name