📜  python迭代字典键值 - Python代码示例

📅  最后修改于: 2022-03-11 14:46:42.888000             🧑  作者: Mango

代码示例2
thisdict = {
  "1": "C language",
  "2": "Java Language",
  "4": "Python Language",
  "3": "C++",
}

print('\n\n')
#print 2nd record from dictionary

n=2
for index, (key, value) in enumerate(thisdict.items()):
    if index == n:
        print(key, '::', value)
        break