如果我创建一个带有dict理解的python字典,但是有重复的键,我保证最后一个项目最终会出现在最后一个字典中吗?我不清楚https://www.python.org/dev/peps/pep-0274/?
new_dict = {k:v for k,v in [(1,100),(2,200),(3,300),(1,111)]}
new_dict[1] #is this guaranteed to be 111, rather than 100?
Run Code Online (Sandbox Code Playgroud)