+ 4
I cant understand the quotient and remainder chapter
6 Respuestas
+ 16
quotient just divide numbers ignoring decimal places, while 5 / 2 == 2.5, 5 // 2 = 2. And remainder give you remainder of that quotient division 5 // 2 = 2 and remainder is 1
+ 3
1.25= .5*2(here .5*2=1)+.25 (here .25 is remainder)
hence,
1.25 divided by .5, quotient is 2 and .25 isn't divided by .5 so it is remainder.
above term is expressed by modulus sign (%),where % shows only remainder,not shows quotient.
it is expressed by
5%2 = 1
11%4 = 3
5%3 = 2
3%5 = 3
6%5 = 1
12%7 = 5
2%2 = 0
1.25%.5 = .25
+ 1
5%2
-4 |2
1
1 is remainder
0
It means that 5//2 it gives the quotient for that particular division
0
一個是無條件捨去餘數,保留商數(整數);一個是無條件捨去商數,保留餘數😸
0
number=888
hours=60
print(int(number / hours))
print(int(number % hours) )
>>14
>>48