4 ms·
My implementation: def santa_list(people): return dict(zip( people[1:] + people[:1], people)) (shuffle if you want
by lazy_guy 9y ago
My implementation:
def santa_list(people):
return dict(zip(
people[1:] + people[:1],
people))
(shuffle if you want to).
- api_or_ipa 9y agoThat's brilliantly simple. I really need to use `zip` more often in my python code. Thanks for sharing your succinct solution.