0

为什么字典的顺序与添加键:值对的顺序不同?

def main():
    dictionary = {}
    names = ['a', 'd', 'g', 's', 'b', 'm', 'f', 'p']
    moves = [1,2,3,4,5,6,7,8]
    for k in range(len(names)):
        dictionary[names[k]] = moves[k]
        print player_dictionary
        print "\n"

main()
4

0 回答 0