Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def odd(ll: list):
- return sum(filter(lambda x: x % 2 != 0, ll)) * len(ll)
- def even(ll: list):
- return sum(filter(lambda x: x % 2 == 0, ll)) * len(ll)
- commands = {
- 'Odd': odd,
- 'Even': even,
- }
- command = input()
- numbers = [int(x) for x in input().split()]
- print(commands[command](numbers))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement