+ 29

7%(5//2) =1. please explain. I don't understand how they get 1?

7th Dec 2015, 6:28 AM
Sean
45 ответов
+ 77
Floor division: How many 2s fits inside 5 ? = 2 Modulus/Remainder: How much space wasn't used when fitting the 2 inside 5 ? 1 space
6th Jan 2016, 7:03 PM
Luiz Vieira
Luiz Vieira - avatar
+ 64
how many times can 2 fit into 5(5//2)the answer is 2 times. so the equation is 7% (2), 2 fits into 7 three times with a remainder of 1. so the answer is 7% (5//2)=1
19th Feb 2016, 6:07 PM
Timothy Duke
Timothy Duke - avatar
+ 54
when 5is divided by 2 the quotient is 2 and when 7 is divided by quotient 2 remainder is 1 (//represent quotient and % represent remainder)
19th Feb 2016, 8:02 AM
kartikey
kartikey - avatar
+ 44
Step 1: Solve the parentheses (5//2) It will output 2, because we are doing floor division. Our output will be in Integer. By simple division (5/2), it will output 2.5, because it prints the value in float. So 5//2 = 2 Now we have 7%(2) Step 2: %(modulus) sign is used for remainder. when we divide 7 by 2, we have remainder 1. 7%2 = 1 So, It will print 1. Hence our answer will be 1.
18th Sep 2016, 1:52 PM
Shahid Islam
Shahid Islam - avatar
+ 19
5//2=4/2=2; then 7%2=7-2*3=1
30th Dec 2015, 5:35 AM
Shelton Wang
+ 10
it's actually asking what is left after fitting the 2 (from 5//2) inside 7, witch is always 1 with any odd number
28th Feb 2016, 12:43 AM
Bradley Patterson
Bradley Patterson - avatar
+ 10
In python3 // means result is integer. so 5//2 reault is 2. and then 7%2 means you want a remainder of 7/2. So finally get 1
9th Aug 2016, 6:20 AM
LukeOnRoad
+ 9
[img]http://i.imgur.com/kPcQsWb.png[/img] 7%(5//2)=1 Step 1: (5//2) = 2 (floored quotient) Step 2: 7%2 = 1 (remainder) Hence: 7%(5//2) = 1
18th Sep 2016, 4:27 PM
yancy
yancy - avatar
+ 7
first 5//2 means 5 how many 2 then 7%2 mean divide 7 until there is no 2 7/2=5/2=3/2=1
6th Jan 2016, 2:38 PM
onur
+ 7
I think I understand. so: 7%(5//2) -> 7%(2) -> we discard the remainder (.5) -> so: 7%2 = 3.5 -> we discard the remainder (.5) again. So: 3/2=1.5 -> discard remainder (.5) =1 Couldn't we also just multiply the remainder by 2 or would that not work uniformly?
2nd Apr 2016, 3:38 PM
octavio
+ 4
(5//2) = the answer is 2. Then 7 % 2, for this you need to find the remainder to get the 7. 7 = ... * 2 + remainder. 7 = 3 * 2 + remainder 7 = 6 + remainder, so 7 = 6 + 1 7= 7 You need make it to the closest number for the multiplication. . I