Created
January 4, 2011 14:35
-
-
Save alice1017/764827 to your computer and use it in GitHub Desktop.
辞書を展開するexp関数
This file contains 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
def exp(dictionary): | |
item = {} | |
item["keys"] = [] | |
item["values"] = [] | |
for i,j in dictionary.iteritems(): | |
item["keys"].append(i) | |
item["values"].append(j) | |
return item |
This file contains 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
def exp(dictionary): | |
item = ([],[]) | |
for i,j in dictionary.iteritems(): | |
item[0].append(i) | |
item[1].append(j) | |
return item |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment