In Python 3, what is the value of 7 / 2?
Correct answer C. 3.5
Explanation
In Python 3 the / operator always performs true division and returns a float, so 7 / 2 is 3.5. Floor division is written //, which gives 3. In Python 2, / between two integers performed floor division, one of the major changes introduced by Python 3.
Answer checked How we write and check questions
Discussion