CBSE Class 11 Computer Science Question 131 of 173

Data Handling — Question 20

Back to all questions
20
Question

Question 15b

What is the output produced by following code?

a, b = bool(0), bool(0.0)
c, d = str(0), str(0.0) 
print (len(a), len(b)) 
print (len(c), len(d))

Answer

The above code will give an error as the line print (len(a), len(b)) is calling len function with bool arguments which is not allowed in Python.

Answer