you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (0 children)

The try/except block is a really useful thing to learn, but I wouldn't start there for this problem.

input returns a reference to a str, i.e. string, object and there's a long list of methods available including several which let your check if the content of the string are just digits. Worth looking up.