dict = {"a" : "apple", "b" : "banana", "g" : "grape", "o" : "orange"} for k in dict: print ("dict[$k] =",dict[k])
dict[$k] = grape
dict[$k] = banana
dict[$k] = apple
dict[$k] = orange
dict = {"a" : "apple", "b" : "banana", "g" : "grape", "o" : "orange"} for k in dict: print ("dict[%s] =" %k,dict[k])
dict[o] = orange
dict[a] = apple
dict[b] = banana
dict[g] = grape
[python] python 中的" "和' '都是完全转义
时间: 2024-10-13 22:55:18