CBSE Class 11 Computer Science
Question 96 of 161
Flow of Control — Question 5
Back to all questions 5
Question Question 5
What is the output of the following lines of code?
if int('zero') == 0 :
print ("zero")
elif str(0) == 'zero' :
print (0)
elif str(0) == '0' :
print (str(0))
else:
print ("none of the above")Answer
The above lines of code will cause an error as in the line if int('zero') == 0 :, 'zero' is given to int() function but string 'zero' doesn't have a valid numeric representation.