+ 1

7%(5/2)

can u please explain

12th Sep 2018, 2:45 PM
Reddy Srinivas
Reddy Srinivas - avatar
5 Respuestas
+ 7
we do 5/2 first because it's in parentheses. 5/2 = 2 in coding so now the problem is 7%2 which gives the remainder. 7%2 = 1 the answer is 1
12th Sep 2018, 3:07 PM
LONGTIE👔
LONGTIE👔 - avatar
+ 6
LONGTIE👔 This is division in Python, hence it results in 2.5. Anyways, 7%(5/2)=7%2.5=7-2.5*2=2
12th Sep 2018, 3:09 PM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 5
Yep. Floor division which requires "//" will return 2
12th Sep 2018, 3:18 PM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 5
Dark Angel i gotcha 👍 thanks for correcting me.
12th Sep 2018, 3:45 PM
LONGTIE👔
LONGTIE👔 - avatar
+ 4
Dark Angel Because there's only one / right
12th Sep 2018, 3:18 PM
LONGTIE👔
LONGTIE👔 - avatar