Name: Anonymous 2013-05-06 4:51
hey guys having some issues with a program
a = float (raw_input ("enter int or float: "))
with this piece of code, every time the input is randomly a string it crashes my program, is there any way to tell python that it's okay to be a string and ignore it????
i was thinking something like....
type (a)
if a == <type 'str'>...IGNORE IT!
...and so on and so forth
didn't seem to work.. any ideas/
a = float (raw_input ("enter int or float: "))
with this piece of code, every time the input is randomly a string it crashes my program, is there any way to tell python that it's okay to be a string and ignore it????
i was thinking something like....
type (a)
if a == <type 'str'>...IGNORE IT!
...and so on and so forth
didn't seem to work.. any ideas/