Really need some help here. Super early in learning Python.
The goal is to take a number and see if the digits are in ascending order. What I have so far is:
You would need a loop.
for example:
a = int(input("Enter a 4-digit number: "))
b = [int(i) for i in str(a)]
def isAscending(b):
#loop for as many digits in the array
for x in range(0, len(b) - 1):
# if the next number is less than the previous return false
if b[x] > b[x+1]:
return False
# did not fail so return true
return True
if isAscending(b):
print ("the number is in ascending order")
else:
print ("the number is not in ascending order")