๐ PYTHON โ DAY 1
Topic: Python Introduction & print() Function
๐น WHAT IS PYTHON?
Python ek high-level programming language hai jo simple English jaisi hoti hai.
WHY PYTHON?
Easy to learn
Beginner friendly
Web, AI, Automation, Data Science sab me use hoti hai
HOW PYTHON WORKS?
Python line by line execute hoti hai (Interpreter based).
๐ DAY 1 โ 10 EXAMPLES
โ
Example 1: Hello World
print("Hello World")Explanation:
print()โ output dikhata hai"Hello World"โ string (text)
โ Example 2: Apna Naam Print Karo
print("My name is Faheem")
๐ String hamesha quotes (” “) me hoti hai
โ Example 4: Multiple Print Statements
print("Python")
print("Programming")
print("Language")๐ Har print() new line me output deta hai
โ Example 5: Print Using Comma
print("My age is", 20)WHY comma?
- Different data types ko ek sath print karne ke liye
โ
Example 6: New Line (\n) Use
print("Hello\nWorld")๐ \n โ new line ke liye hota hai
โ Example 7: Single Quotes Use
print('Python is easy')๐ Python me ' ' aur " " dono valid hain
โ Example 8: Double Quotes Inside String
print("Python is called \"Easy Language\"")๐ \ escape character hota hai
โ
Example 9: Print with sep
print("Python", "Java", "C++", sep=" | ")output : Python | Java | C++
๐ sep separator change karta hai
โ
Example 10: Print with end
print("Hello", end=" ")
print("World")output : Hello World
๐ end new line ko replace karta hai
๐ DAY 1 SUMMARY (Notes Style)
print()โ output ke liye- String โ
" "ya' ' \nโ new linesepโ separatorendโ line ending control
๐ PRACTICE (Homework)
- Apna naam aur city print karo
- 3 favourite subjects print karo
- Ek line me naam aur age print karo
๐ PYTHON โ DAY 2
Topic: Variables in Python
๐น VARIABLE KYA HAI? (WHAT)
Variable ek container hota hai jisme hum data store karte hain.
๐น VARIABLE KYON USE KARTE HAIN? (WHY)
- Data ko bar-bar use karne ke liye
- Code readable banane ke liye
- Values change (update) karne ke liye
๐น VARIABLE KAISE BANATE HAIN? (HOW)
Python me = assignment operator se variable banta hai.
variable_name = value๐ DAY 2 โ 10 EXAMPLES (WITH EXPLANATION)
โ Example 1: Integer Variable
age = 20
print(age)
Explanation:
ageโ variable name20โ integer valueprint(age)โ value show karta hai
โ Example 2: Float Variable
price = 99.50
print(price)
๐ Decimal number = float
โ Example 3: String Variable
name = "Amit"
print(name)
๐ Text data hamesha quotes me hota hai
โ Example 4: Boolean Variable
is_student = True
print(is_student)
๐ Boolean sirf True / False hota hai
โ Example 5: Multiple Variables
name = "Rahul"
age = 21
city = "Delhi"
print(name)
print(age)
print(city)
๐ Alag-alag data ko alag variables me store kar sakte hain
โ Example 6: Print with Variables
name = "Neha"
age = 22
print("Name:", name)
print("Age:", age)
๐ String + variable print karne ke liye comma use hota hai
โ Example 7: Variable Overwrite
x = 10
print(x)
x = 20
print(x)
Explanation:
- Pehle
x = 10 - Phir
x = 20โ old value replace ho gayi
โ Example 8: Variable Swapping
a = 5
b = 10
a, b = b, a
print(a)
print(b)
๐ Python me swapping extra variable ke bina ho jati hai
โ
Example 9: Type Check (type())
x = 100
y = 5.5
z = "Python"
print(type(x))
print(type(y))
print(type(z))
๐ type() batata hai variable ka data type
โ Example 10: Simple Calculation Using Variables
a = 10
b = 3
sum = a + b
print("Sum is:", sum)
๐ Variables ka use calculation ke liye hota hai
๐ DAY 2 SUMMARY (Notes)
- Variable = data store karne ka box
- Python me data type manually likhna nahi padta
=assignment operator hota hai- Value overwrite ho sakti hai
type()se data type check hota hai
๐ง DAY 2 PRACTICE (Homework)
- Apna naam, age aur college variable me store karo
- Do numbers ka multiplication variable se karo
- Ek boolean variable banao (True/False)
๐ PYTHON โ DAY 3
Topic: Data Types & Type Conversion
๐น DATA TYPE KYA HAI? (WHAT)
Data type batata hai ki variable ke andar kis type ka data stored hai.
๐น DATA TYPE KYON ZAROORI HAI? (WHY)
- Python ko samajhne ke liye ki kaunsa operation possible hai
- Errors se bachne ke liye
- Memory aur calculation sahi rakhne ke liye
๐น PYTHON KE MAIN DATA TYPES (HOW)
intโ integer (whole number)floatโ decimal numberstrโ string (text)boolโ True / False
๐ DAY 3 โ 10 EXAMPLES (WITH EXPLANATION)
โ
Example 1: Integer (int)
x = 50
print(x)
print(type(x))
๐ int โ whole number (no decimal)
โ
Example 2: Float (float)
price = 99.99
print(price)
print(type(price))
๐ Decimal value = float
โ
Example 3: String (str)
language = "Python"
print(language)
print(type(language))
๐ Text data hamesha quotes me hota hai
โ
Example 4: Boolean (bool)
is_active = True
print(is_active)
print(type(is_active))
๐ Boolean sirf True / False
โ Example 5: String + String
first_name = "Amit"
last_name = "Sharma"
print(first_name + last_name)
๐ Strings add hone par join (concatenate) ho jati hain
โ Example 6: Integer + Integer
a = 10
b = 20
print(a + b)
๐ Numbers add hone par math addition hota hai
โ Example 7: Integer + Float
x = 10
y = 2.5
print(x + y)
๐ Result hamesha float hota hai
โ Example 8: Type Conversion (int โ float)
a = 5
b = float(a)
print(b)
print(type(b))
๐ float() โ int ko float me convert karta hai
โ Example 9: Type Conversion (string โ int)
num = "100"
num2 = int(num)
print(num2)
print(type(num2))
๐ String ke andar number hona chahiye, warna error aayega
โ Example 10: Wrong Type Example
a = "10"
b = 5
print(a + str(b))
Explanation:
astring haibint hai- Pehle
bkostr()me convert kiya
๐ Same data type hona zaroori hai
๐ DAY 3 SUMMARY (Notes)
- Data type batata hai data ka nature
- Python automatically data type assign karta hai
type()se data type check hota hai- Type conversion โ
int(),float(),str() - Mixed data type me conversion zaroori hota hai
๐ง DAY 3 PRACTICE (Homework)
- Ek int ko float me convert karo
- User se number input leke uska square nikalo
- String aur number ko sahi tarike se add karo
๐ PYTHON โ DAY 4
Topic: User Input (input() Function)
๐น INPUT KYA HAI? (WHAT)
Input ka matlab hota hai user se data lena.
๐น INPUT KYON ZAROORI HAI? (WHY)
- Program ko dynamic banane ke liye
- Har baar alag value ke saath program chalane ke liye
๐น INPUT KAISE LETE HAIN? (HOW)
Python me input() function ka use hota hai.
variable = input("Message")
๐ Important Note:input() hamesha string data return karta hai.
๐ DAY 4 โ 10 EXAMPLES (WITH EXPLANATION)
โ Example 1: Name Input
name = input("Enter your name: ")
print("Hello", name)
๐ User jo likhega, wo name variable me store ho jayega
โ Example 2: Age Input (String)
age = input("Enter your age: ")
print("Your age is", age)
๐ Yahan age string hai
โ Example 3: Age Input (Integer)
age = int(input("Enter your age: "))
print(age)
๐ int() use karke string โ integer banaya
โ Example 4: Two Numbers Input
a = int(input("Enter first number: "))
b = int(input("Enter second number: "))
print("Sum is:", a + b)
๐ Calculation ke liye type conversion zaroori hai
โ Example 5: Float Input
price = float(input("Enter product price: "))
print("Price:", price)
๐ Decimal value ke liye float()
โ Example 6: Full Sentence Input
msg = input("Enter a message: ")
print(msg)
๐ Space ke saath bhi input accept hota hai
โ Example 7: Multiple Inputs (One Line)
name, city = input("Enter name and city: ").split()
print(name)
print(city)
๐ split() space ke base par data todta hai
โ Example 8: Calculate Square
num = int(input("Enter number: "))
print("Square:", num * num)
๐ User input se calculation
โ Example 9: String + Number (Correct Way)
age = int(input("Enter age: "))
print("Next year age:", age + 1)
๐ Pehle int conversion, phir addition
โ Example 10: Input Error Example
num = input("Enter number: ")
print(num + "10")
Explanation:
numstring hai"10"bhi string hai- Isliye result string join hoga
๐ Math ke liye conversion zaroori hai
๐ DAY 4 SUMMARY (Notes)
input()user se data leta hai- Input hamesha string hota hai
- Math ke liye
int()/float()use karo split()multiple inputs ke liye useful- Galat conversion se error aa sakta hai
๐ง DAY 4 PRACTICE (Homework)
- User se 3 numbers input leke average nikalo
- User se naam aur age input leke print karo
- User se length input leke square nikalo
๐ PYTHON โ DAY 5
Topic: Operators in Python
๐น OPERATOR KYA HAI? (WHAT)
Operator wo symbols hote hain jo kisi operation ko perform karte hain.
Example: + - * /
๐น OPERATOR KYON USE HOTE HAIN? (WHY)
- Calculation karne ke liye
- Comparison ke liye
- Decision making ke liye
๐น PYTHON KE MAIN OPERATORS (HOW)
1๏ธโฃ Arithmetic Operators
2๏ธโฃ Comparison Operators
3๏ธโฃ Logical Operators
๐ DAY 5 โ 10 EXAMPLES (WITH EXPLANATION)
โ
Example 1: Addition (+)
a = 10
b = 5
print(a + b)
๐ + addition karta hai
โ
Example 2: Subtraction (-)
a = 10
b = 5
print(a - b)
๐ - subtraction karta hai
โ
Example 3: Multiplication (*)
a = 10
b = 5
print(a * b)
๐ * multiplication karta hai
โ
Example 4: Division (/)
a = 10
b = 4
print(a / b)
๐ / ka result hamesha float hota hai
โ
Example 5: Modulus (%)
a = 10
b = 3
print(a % b)
๐ % remainder deta hai
โ
Example 6: Power (**)
a = 2
b = 3
print(a ** b)
๐ 2 ** 3 = 8
โ Example 7: Comparison Operator
a = 10
b = 5
print(a > b)
print(a < b)
print(a == b)
๐ Output True / False hota hai
โ
Example 8: Logical AND (and)
age = 20
print(age > 18 and age < 25)
๐ Dono condition true honi chahiye
โ
Example 9: Logical OR (or)
marks = 35
print(marks > 40 or marks == 35)
๐ Koi ek condition true ho to result true
โ Example 10: Operator Precedence
result = 10 + 2 * 5
print(result)
Explanation:
- Pehle
*hoga - Phir
+
๐ Output: 20
๐ DAY 5 SUMMARY (Notes)
- Arithmetic operators โ calculation
- Comparison operators โ True / False
- Logical operators โ multiple conditions
/hamesha float deta hai- Operator precedence important hoti hai
๐ง DAY 5 PRACTICE (Homework)
- User se 2 numbers input leke sab arithmetic operations karo
- Check karo number even ya odd (
%) - Age check program using logical operators


