How to update value of existing key in dictionary with Python

1 Answer

0 votes
dic = {'python':34, 'java':12, 'c':19, 'c++':18, 'c#':35}
  
dic.update(java = 100)

 
print(dic)
  
  
  
'''
run:
  
{'python': 34, 'java': 100, 'c': 19, 'c++': 18, 'c#': 35}
  
'''

 



answered Jan 29, 2020 by avibootz

Related questions

...