the-honk/languages/python/calculators/_helpers/intInput.py
2022-03-31 16:19:23 +01:00

8 lines
183 B
Python

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