QuestenaPractice that shows what to review next
Question 112

What are the exact value and type of 4 / 2 in Python?

  1. int 2
  2. int 0
  3. float 2.5
  4. float 2.0Correct answer

Explanation

The slash performs true division, so integer operands still produce the floating-point value 2.0. An exact whole-number quotient does not cause Python to switch the result back to int.

Continue with this test

Start practice
Question 112: What are the exact value and type of 4 / 2 in Python? · Python Fundamentals · Questena