ProgrammingEasyTCS NQT · Wipro pattern
What is printed?
What is printed?
print(type(10 / 5))
- A. <class 'float'>
- B. 2.0
- C. <class 'int'>
- D. 2
Correct answer: A. <class 'float'>
In Python 3 the / operator is true division and always returns a float, even when the result is whole (10/5 is 2.0). Use // for integer (floor) division.
More Python Programming questions
- Which of these built-in Python types is immutable?
- What is printed? python s = "placement" print(s[2:5])
- What is printed? python print(len({1, 2, 2, 3, 3, 3}))
- Which keyword turns an ordinary Python function into a generator function?
- What is printed? python x = [1, 2, 3] x.append([4, 5]) print(len(x))
- What is printed? python print(2 3 2)