Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from collections import defaultdict
- from random import seed
- import random
- def rand():
- return random(0, 10)
- map = defaultdict(int)
- for i in range(0, 26):
- key = chr(ord('A') + i)
- map[key] = random.randint(0, 10)
- print(map)
- for key in map:
- print(key, map[key])
- reduce = defaultdict(list)
- for key in map:
- reduce[map[key]].append(key)
- print(reduce)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement