Quote:
Originally Posted by MrOmega
Call me stupid but what are some actual purpose of using float( "123str");
|
Let's assume we have user input. We want a number. The user gives us a string instead of a number. Ideally, throwing it into the float()-bin will return -1 and tell us it's a string this way. When there are numbers at the beginning, it won't. Don't see an issue though. Of course, this is just an example. Might be a problem elsewhere. But that can be worked around.