Computer Science
Find the errors(s)
print (type (int("123")))
print (type (int("Hello")))
print (type (str("123.0")))
Python Data Handling
17 Likes
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.
Answered By
11 Likes
Related Questions
Find the errors(s)
name = "HariT" print (name) name[2] = 'R' print (name)Find the errors(s)
a = bool (0) b = bool (1) print (a == false) print (b == true)Find the errors(s)
pi = 3.14 print (type (pi)) print (type ("3.14")) print (type (float ("3.14"))) print (type (float("three point fourteen")))Find the errors(s)
print ("Hello" + 2) print ("Hello" + "2") print ("Hello" * 2)