Last active
September 30, 2019 00:51
-
-
Save shoark7/d086dfc3a4f335370ced5bf5684fd154 to your computer and use it in GitHub Desktop.
easy busy dict maker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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