+ 1

I don’t understand this python code

I had this question In a challenge. Can someone explain how the answer is 2 def func(a,b): c= (a+b) + (a+b) d= c%5 print(d) func(3,3)

1st Jan 2018, 11:29 PM
Spencer Harris
Spencer Harris - avatar
3 Respuestas
+ 6
(3+3)+(3+3) = 12 12 % 5 = 2, % is remainder operator of divison because 12 / 5 = 2 and remainder is 2
1st Jan 2018, 11:46 PM
Vukan
Vukan - avatar
+ 2
Thank you so much!
1st Jan 2018, 11:52 PM
Spencer Harris
Spencer Harris - avatar
+ 2
nothing 😃
1st Jan 2018, 11:54 PM
Vukan
Vukan - avatar