Skip to content

Instantly share code, notes, and snippets.

@a2chub
Created May 8, 2015 08:08
Show Gist options
  • Save a2chub/1574293d405f03f47396 to your computer and use it in GitHub Desktop.
Save a2chub/1574293d405f03f47396 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
#coding:utf-8
key_list = range(10)
val_list = range(10)
val_list.reverse()
print "正解: {0:9, 1:8 ...}"
def unko(keyData, valData):
result = {}
cnt = 0
for now_key in key_list:
result[now_key] = val_list[ cnt ]
cnt += 1
return result
def myMap(keyData, valData):
result = dict(zip(keyData, valData))
return result
def main():
print key_list
print val_list
print unko(key_list, val_list)
print myMap(key_list, val_list)
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment