Check if the digits in the number are in increasing sequence in python
you could zip the string representation of the number with a shifted self and iterate on consecutive digits together. Use all
to check that numbers follow, using a modulo 10 to handle the 0 case.
num = 7890
result = all((int(y)-int(x))%10 == 1 for x,y in zip(str(num),str(num)[1:]))
You can simply check if the number, when converted to a string, is a substring of '1234567890'
:
str(num) in '1234567890'