I didn't get the quotient and remainder part | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

I didn't get the quotient and remainder part

26th Oct 2016, 4:28 PM
lakshay
lakshay - avatar
2 Answers
+ 4
Quotient & Remainder are basic Math logics See this example, you must have done that in school 5 -------- 4 | 22 | 20 -------- 2 If you divide 22 by 4 your quotient is 5 and remainder is 2 While in programming in python we use (//) for getting quotient or whole number value while dividing and (%) for remainder 22 // 4 = 5 (To get Quotient) 22 % 4 = 2 (To get remainder )
26th Oct 2016, 5:02 PM
Waqas Asghar Bhalli
Waqas Asghar Bhalli - avatar
+ 1
For example: 42 // 9 is 4 (the quotient) 42 % 9 is 6 (the remainder) because 42 is 9*4 + 6, and 0<=6<9.
26th Oct 2016, 4:35 PM
Zen
Zen - avatar