sidorenkov

Answer #1

Aug 3rd, 2021
672
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def update_dict(key, value, defaults=None):
  2.     if not defaults:
  3.         defaults = {}
  4.     defaults[key] = value
  5.     print(defaults)
  6.    
  7.    
  8. update_dict(key='fruit', value='apple')
  9. update_dict(key='vegetable', value='tomato', defaults = {'tree': 'oak'})
  10. update_dict(key='car', value='ferrari')
  11.  
RAW Paste Data