Computer Science
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")))
Python Data Handling
13 Likes
Answer
In the line print (type (float("three point fourteen")))
, string "three point fourteen" is given as an argument to float() but it cannot be converted into a valid floating-point number so it causes an error.
Answered By
7 Likes
Related Questions
Find the errors(s)
print ("Hello"/2) print ("Hello" / 2)
Find the errors(s)
print ("Hello" + 2) print ("Hello" + "2") print ("Hello" * 2)
Find the errors(s)
a = bool (0) b = bool (1) print (a == false) print (b == true)
Find the errors(s)
print (type (int("123"))) print (type (int("Hello"))) print (type (str("123.0")))