+ 2

why 7%(5//2) is 1?

4th Oct 2016, 3:17 PM
Lucas Gonzalez
Lucas Gonzalez - avatar
4 Respostas
+ 10
// is operator for floor division % is operator for modulo for example: 10 // 3 = 3 and 10 % 3 = 1 because: 10 = 3*3 + 1 5 // 2 = 2 7 % 2 = 1
4th Oct 2016, 3:24 PM
Amarie
+ 2
Thank you so much :)
4th Oct 2016, 4:38 PM
Lucas Gonzalez
Lucas Gonzalez - avatar
0
how did you done this plz give some details
10th Oct 2016, 1:47 AM
Aamir Zaman
Aamir Zaman - avatar
0
@albert (your nick was not the best choice ;-) ) 7 % 2 is modulo-division. This means that the output of this operation is the remainder - here 1. some more examples: 5 % 3 = 2 14 % 5 = 4 7 % 4 = 3 Also see here for a more detailed explanation: https://en.Wikipedia.org/wiki/Euclidean_division Hope this helps. Regards Tom
15th Oct 2016, 7:13 PM
TomMUC