I was trying to get a python function which judges whether a number is written in ascending or descending order (eg 12345 --> ascending, 54321 --> descending, 12321 --> neither).
For this, I first tried making a number into a string type and then converted to a list:
n=12321
for i in list(str(n)):
But then how can I finish comparing each digits of number to show that n belongs to neither?
Are there some ways I could do this without using specific libraries?