Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #вариант с лямбдой
- a = [1, 6, 21, 7, 9, 11111, 42, 10, 12, 63]
- mx = max(a, key=lambda x: 1 if x % 21 != 0 else x)
- #вариант с циклом
- mx1 = 0
- for e in a:
- if e % 21 == 0:
- mx1 = max(mx1, e)
- print(mx, mx1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement