我试图创建字典,但是键总是重新排列。我希望按适当的顺序安排钥匙。在python中有可能吗?
#!/bin/python
my_val = ["vel", "acc", "force"]
my_dict=dict()
for v in my_val:
my_dict[v] = []
for l in my_val:
print("l = ", l)
print("dict re-arranges")
for key in my_dict:
print("key = ", key)
l = vel l = acc l = force dict re-arranges key = force key = acc key = vel