首页 > 其他分享 >字典遍历 dict1.values,dict1.keys,dict1.items

字典遍历 dict1.values,dict1.keys,dict1.items

时间:2023-05-18 14:23:33浏览次数:42  
标签:end keys items values print dict1

'''  '''
dict1 = {'K1': 'Aa', 'K2': 'Bb', 'K3': 'Cc'}
for k in dict1.keys():
    print(k, end=' \t')
print()

for v in dict1.values():
    print(v, end='\t')
print()

for k, v in dict1.items():
    print(k, '-->', v, end=' | ')
print()

print(dict1.get('K12'), "NoThisKey")
'''  '''

  

 

标签:end,keys,items,values,print,dict1
From: https://www.cnblogs.com/sangern/p/17411797.html

相关文章