You can try to parse the string to an integer, and if you cannot, print accordingly, but if you can and the integer is between 1 and 10, decide accordingly
def check_int(s):
is_int = False
try:
int(s)
is_int = True
except:
pass
return is_int
rating = input('Enter an integer rating between 1 and 10>>')
#If string can be converted to integer
if check_int(rating):
#Convert it to an integer and compare ranges
r = int(rating)
if 1<=r<=10:
print('Integer is', r)
else:
print('Integer is not between 1 and 10')
#Else print error
else:
print('Not an integer')
The output will be
Enter an integer rating between 1 and 10>>11
Integer is not between 1 and 10
Enter an integer rating between 1 and 10>>6
Integer is 6
Enter an integer rating between 1 and 10>>hello
Not an integer