Skip to content

Instantly share code, notes, and snippets.

@shoark7
Last active September 30, 2019 00:51
Show Gist options
  • Save shoark7/d086dfc3a4f335370ced5bf5684fd154 to your computer and use it in GitHub Desktop.
Save shoark7/d086dfc3a4f335370ced5bf5684fd154 to your computer and use it in GitHub Desktop.
easy busy dict maker
from string import ascii_lowercase as LOWERS
# 풀이 1.
ans = {}
for c, n in zip(LOWERS, range(1, len(LOWERS)+1)):
ans[c] = n
print(ans)
# 풀이 2.
ans = {c: n for c, n in zip(LOWERS, range(1, len(LOWERS)+1))}
print(ans)
# 풀이 3.
ans = dict(zip(LOWERS, range(1, len(LOWERS)+1)))
print(ans)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment