I think the simplest way to check if your number is an int or not is to run a simple check, like:
if int(x) == x:
# do stuff here!
The reason that works is because if you get a string as an input, it'll look like this to the computer:
# or, with a number:
whereas an int looks like
with no quotes surrounding it.
if "1" == 1 doesn't trigger, because they're different, but
if 1 == 1 will trigger, because they're the same. Converting something like
"1" to an int (it's currently a string), then checking it against the original lets us know whether our input was a number or not.
I hope this helps, feel free to ask any more questions you may have!