Advertisement
c32team

python question #1

Sep 21st, 2023
1,499
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def update_dict(key, value, defaults={}):
  2.     defaults[key] = value
  3.     print(defaults)
  4.    
  5.    
  6. update_dict(key='fruit', value='apple')
  7. update_dict(key='vegetable', value='tomato', defaults = {'tree': 'oak'})
  8. update_dict(key='car', value='ferrari')
  9.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement