Computer Science, asked by Parthasaha6427, 3 months ago

x = 10.8
y = 5
print (x//y)

Answers

Answered by LuckyLao
0

Answer:

2.0

Explanation:

Here, x, y = 10.8, 5

The // is used for floor division in Python.

If you have heard of the Greatest Integer Function in mathematics, this might be easier to understand. Both cases (maths and python) are very similar, the only difference is that in Python the floor value of the quotient is calculated after dividing the number (floordiv operator //).

stdout:

2.0

NOTE - The answer is a floating number (decimal) because the arguments passed in the floordiv expression are not purely integral (the dividend 10.8 is a floating number while the divisor 5 is an integer). The answer is always of int() type when the arguments passed in the floordiv expression are purely integral.

Similar questions