字典

字典:dict = {“key1”:“value1”,“key2”:“value2”}

for key, value in dict.items():遍历字典所有键-值对

for key in dict.keys():遍历字典中的所有键

for value in dict.values():遍历字典中所有值

你可能感兴趣的:(字典)