+ 1

7%(5/2)

can u please explain

12th Sep 2018, 2:45 PM
Reddy Srinivas
Reddy Srinivas - avatar
5 Answers
+ 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