the-honk/python/calculators/_helpers/floatInput.py
2021-08-26 02:42:17 +01:00

8 lines
201 B
Python

# helper method to easily take in float inputs
def floatInput(text):
while True:
try:
x = float(input(text + '\n'))
return x
except ValueError:
print('You must input a float integer!\n')