a = raw_input(\'How much is 1 share in that company? \') while not a.isdigit(): print(\"You need to write a number!\\n\") a = raw_input(\'How much is 1 shar
s = '12.32' if s.replace('.', '').replace('-', '').isdigit(): print(float(s))
Note that this will work for negative floats as well.
float