0

what is the solution of (6//1.5) ?

7th Oct 2022, 6:38 AM
siddharth gupta
siddharth gupta - avatar
1 Odpowiedź
+ 1
The answer is 4.0. You can always use the python interpreter to find out but let's say you don't understand how the // works. // is the floor division, what does that mean? It will always round to below, so 5/2 = 2.5 but 5//2 = floor(2.5) = 2. But the earlier result was 4.0 not 4! That's because since you had a float on the operation, it will give a float answer, so: 5//2.0 = 2.0 and 5.0//2 = 2.0.
7th Oct 2022, 8:46 AM
Tomás Ribeiro
Tomás Ribeiro - avatar