7 lines
182 B
Python
7 lines
182 B
Python
def inputTypeCheck(message, type, errorMessage):
|
|
while True:
|
|
inputValue = input(message)
|
|
try:
|
|
return type(inputValue)
|
|
except ValueError:
|
|
print(errorMessage) |