Get value by key : Get : Dictionary PYTHON TUTORIALS


PYTHON TUTORIALS » Dictionary » Get »

 

Get value by key


dict = {'A':'1''B':'2' }
dict1 = dict.copy()
print dict1
print dict1.get('A')
print dict1.get('xxx')
print dict1.get('xxx', 'no such key')



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Dictionary
» Get