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
The provided answers fail if the string contains some special characters such as underscore (e.g. '1_1'). The following function returns correct answer in all case that I tested.