Lesson — Foundation

GINTEE
PYTHON SE.

Run-rate, bill split, interest, percentage — har hisaab ke peeche teen number types aur kuch operators hain. Is lesson ke baad koi formula nahi rokega.

⏱ 18 min• BeginnerPrerequisite: Casting

WHY: har hisaab number hai

Cricket run-rate, Swiggy bill split, bank interest, marks percentage — har calculation ke peeche Python numbers hain. Teen types samajh lo, phir koi formula nahi rokega.

python▶ Run
runs = 186
balls = 120
overs = balls / 6
print(runs / overs)  # 9.3 run-rate

print(7 / 2)   # 3.5 (divide)
print(7 // 2)  # 3 (floor — dashamlav kata)
INT

Poora number: 10, -3. Count, index, quantity.

FLOAT

Decimal: 9.99, 3.14. Price, average, percentage.

// % **

// floor divide, % remainder, ** power — teeno MNC favourite.

HOW: operator chunna

Poora division chahiye to /, sirf poora hissa chahiye to //, bacha hua chahiye to %. Paise ka hisaab float me karo, count int me. round(9.99, 1) decimal control karta hai.

python▶ Run
bill = 1000
friends = 3
print(bill // friends)  # 333 har ek
print(bill % friends)   # 1 bacha
print(round(10 / 3, 2))   # 3.33
Try it: over ka hisaabRuns, balls badal kar dekho
Run Python dabayein

Quick check

7 // 2 ka output kya hoga?

Double slash decimal kaat deta hai — sirf poora hissa bachta hai.

🎓
Guido-style insight: Computer gintee me thoda alag hai. 0.1 + 0.2 exact 0.3 nahi hota (binary fraction). Paise ka hisaab hamesha soch-samajh kar.
python▶ Run
print(0.1 + 0.2)  # 0.30000000000000004!
print(10 % 3)  # 1 (remainder)
print(2 ** 10)  # 1024

MNC tip: Float wala fact bol do — interviewer samjhega depth hai.

Common mistakes

Calculation confident?

Ab text numbers ko aur powerful banao — strings par wapas chalo.

Popular courses: Data Science Course in Lucknow · AI Course in Lucknow · Python Course in Lucknow · Power BI Course · Data Analytics Course