Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def f(x):
- smm = 0
- pr = 1
- while x != 0:
- smm += x % 10
- pr *= x % 10
- x //= 10
- return smm, pr
- nums = []
- for i in range(87921, 88187+1):
- if f(i)[0] % 14 == 0 and f(i)[1] % 18 == 0 and f(i)[1] != 0:
- nums.append(f(i))
- *(print(*x) for x in sorted(nums)),
Advertisement
Add Comment
Please, Sign In to add comment