7%(5 // 2) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
20th Jun 2020, 2:41 PM
Bhawna Singla
Bhawna Singla - avatar
4 Answers
+ 3
So what is the question?You can simply run it in solo playground and check the answer
20th Jun 2020, 2:49 PM
Abhay
Abhay - avatar
+ 4
Then you should mention in the question that you need an explanation for it , // is floor division ,5//2 results in 2.5 which evaluates to 2 now in 7%2, "%" returns remainder ,so after division you get remainder as 1
20th Jun 2020, 2:56 PM
Abhay
Abhay - avatar
+ 4
Bhawna Singla it's just basic maths. Things inside the brackets will be evaluated first(because of highest precedence) so (5//2=2) And then 7%2 = 1. If you don't know how modulo operator ("%") work then it just divides the numbers and return the remainder.
20th Jun 2020, 2:58 PM
Arsenic
Arsenic - avatar
+ 1
@abhay i want explanation of this ques
20th Jun 2020, 2:51 PM
Bhawna Singla
Bhawna Singla - avatar