KnowledgeBoat Logo

Computer Science

Write the output of the following code:

a = 10/2
b = 10//3
print(a, b)
  1. 5 3.3
  2. 5.0 3.3
  3. 5.0 3
  4. 5 4

Python Data Handling

5 Likes

Answer

5.0 3

Reason — The expression a = 10/2 performs floating-point division, resulting in a being assigned the value 5.0. Similarly, the expression b = 10//3 performs integer division (floor division), resulting in b being assigned the value 3. The print(a, b) statement prints the values of variables a and b, which are 5.0 and 3 respectively.

Answered By

1 Like


Related Questions