Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def div(num: str, division: int):
- if division == 10: return num[-1] == "0"
- elif division == 4: return int(num) % 4 == 0
- elif division == 2: return int(num) % 2 == 0
- elif division == 5: return int(num[-1]) % 5 == 0
- else:
- if len(num) < 3: return False
- else: return int(num) % 8 == 0
- N = input()
- num, lst, res = N[-3:], [2, 4, 5, 8, 10], [1]
- for i in lst:
- if div(num, i):
- res.append(i)
- print(res)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement