Python Learning Series · @onlysamarrr · Day 4 / 30
Day 4 covers arithmetic operators: + adds, - subtracts, * multiplies, / divides and always gives a float, // gives the floor of the division, % gives the remainder, and ** gives a power.
Phase: Beginner · Reels: 16/450 – 20/450
Day 4 covers arithmetic operators: + adds, - subtracts, * multiplies, / divides and always gives a float, // gives the floor of the division, % gives the remainder, and ** gives a power.
print(7 + 2) print(7 - 2) print(7 * 2) print(7 / 2) print(7 // 2) print(7 % 2) print(2 ** 10) print(-7 // 2)
9 5 14 3.5 3 1 1024 -4
Billing apps use // and % to split a bill, find change, and check whether a number is even or odd.
Select (tick) an option, then tap Check answer to see instantly whether your answer is right or wrong, with an explanation. You can change your answer and check again.
Q1. What is 7 // 2?
Q2. What is 7 % 2?
Q3. What is 7 / 2?
| 16/450 | Concept | + - * / basics |
| 17/450 | Live demo | // aur % ka magic |
| 18/450 | Common mistake | / vs // confusion |
| 19/450 | Quiz | Quiz: even ya odd |
| 20/450 | Interview / real life | Real life: bill split calculator |