Advertisement
STANAANDREY

lsd4 2.1

Oct 21st, 2022
699
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.27 KB | None | 0 0
  1. def makeLst(nr, rev):
  2.     lst = []
  3.     while nr != 0:
  4.         digit = nr % 10
  5.         if digit < 7 and digit % 2 == 1:
  6.             lst.append(nr % 10)
  7.         nr //= 10
  8.    
  9.     if rev:
  10.         lst.reverse()
  11.  
  12.     return lst
  13.  
  14. print(makeLst(int(input("nr: ")), True))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement