I'm trying to write a code to get whether an integer is in descending order. However, I can run this code only with the numbers like 123 or 321 but not with 34653. I always get this error when i use non-regular numbers : "IndexError: string index out of range". I have to use for-while loops to solve that question because we didn't cover the functions, lists etc. in the class. So, how can I fix it by using loops ? This is what I've done so far:
r_int = input("Enter integer value: ")
digits = len(r_int)
for i in range (0,digits+1):
if r_int[i] > r_int[i+1]:
print("Digits are in descending order")
r_int = input("Enter integer value: ")
elif int(r_int) <0:
print("Value must be positive...")
r_int = input("Enter integer value: ")
else:
print("Digits are not in descending order")
for i in range (0,digits)