I've tried to find out how to check for string input for mario.py. I know to check for the range of integers when getting input from the user, but if they enter a string instead of a number, is there any way to set up a condition to check for that? I've looked through the documentation but everything I try comes back to:
Enter height of pyramid no higher than 23:
25
Enter height of pyramid no higher than 23:
foo
Retry: ^CTraceback (most recent call last):
File "mario.py", line 8, in <module>
height = cs50.get_int()
File "/usr/lib/python3/dist-packages/cs50/cs50.py", line 49, in get_int
s = get_string();
File "/usr/lib/python3/dist-packages/cs50/cs50.py", line 78, in get_string
s = sys.stdin.readline()
KeyboardInterrupt
It seems if I use get_int() and the user enters a string, then right away that's an error for the program.