CBSE Class 11 Computer Science Question 136 of 173

Data Handling — Question 25

Back to all questions
25
Question

Question 18c

Find the errors(s)

print (type (int("123")))  
print (type (int("Hello")))
print (type (str("123.0")))

Answer

In the line print (type (int("Hello"))), string "Hello" is given as an argument to int() but it cannot be converted into a valid integer so it causes an error.

Answer