208k views
2 votes
Given a number N, write a code to print all psoitive numbers less than N in which all adjacent digits differ by 1

User Elsni
by
4.8k points

1 Answer

4 votes

Answer:

def lesser_adjacent_num ( N ):

N = int( N )

while N == True:

next = N - 1

print if next >= 0 ? next : break

Step-by-step explanation:

The python function above called "lesser_adjacent_num" accepts an argument called "N" which is an integer. The function print the number "next" which is a number less than the N integer for every loop for the condition where N is not zero.

User Pierrebo
by
6.0k points