Python Tutorial - Numbers u0026 Math
๐ข Numbers aur Math Operations
๐ Real Life Mein:
Har din hum calculations karte hain:
๐ฐ "Shopping bill calculate karna" - Addition
๐ "Pizza ko friends mein baantna" - Division
๐ฑ "Monthly recharge x 12 months" - Multiplication
๐ช "Total price - discount" - Subtraction
Python sabse tez calculator hai!
โ Basic Math Operations
| Operator | Operation | Example | Result |
|---|---|---|---|
+ | Addition | 10 + 5 | 15 |
- | Subtraction | 10 - 3 | 7 |
* | Multiplication | 5 * 4 | 20 |
/ | Division | 10 / 2 | 5.0 |
// | Floor Division | 10 // 3 | 3 |
% | Modulus (Remainder) | 10 % 3 | 1 |
** | Power | 2 ** 3 | 8 |
๐ซ Real Example - Chocolate Distribution
# Total chocolates
chocolates = 25
friends = 4
# Har ek ko kitne milenge?
each_gets = chocolates // friends # 6
leftover = chocolates % friends # 1
print(f"Har friend ko: {each_gets} chocolates")
print(f"Bache hue: {leftover} chocolate")
๐ต Shopping Bill Calculator
Practical Example
# Shopping items
shirt = 500
jeans = 1200
shoes = 800
# Total
total = shirt + jeans + shoes # 2500
# 10% discount
discount = total * 0.10 # 250
final_price = total - discount # 2250
print(f"Total: โน{total}")
print(f"Discount: โน{discount}")
print(f"Pay: โน{final_price}")
Operator Precedence: PEMDAS rule - Parentheses, Exponents, Multiply/Divide, Add/Subtract
Example
x = 10 + 5
y = 10 * 2
print(x, y)