KnowledgeBoat Logo

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