0
字典如何循環字典上半年將蟒蛇遍歷上半年蟒蛇
這種迭代的所有值在字典中
for key, value in checkbox_dict.iteritems():
print key,value
但我想遍歷上半年只有字典。
一個辦法就是做這樣
for key, value in dict(checkbox_dict.items()[:11]).iteritems():
print key,value
有沒有什麼更好的辦法也?
你是什麼意思半字典?你能用一個例子來澄清嗎? – thefourtheye
你想迭代哪一半? –
請記住,詞典是**無序**。 – Christian