Ask coding questions

← Back to all posts
I want a help with dictionary problem
azza1551

1 - How to write a function that takes a dictionary and a key and determines if that key is in the dictionary (i.e. the function outputs True if the key is in the dictionary, and False otherwise). This should output: True and False

2 - How to write a function that takes two dictionaries with unique keys and merge them.
This should output: {'Ten': 10, 'Twenty': 20, 'Thirty': 30, 'Fourty': 40, 'Fifty': 50}

Voters
azza1551
Comments
hotnewtop
Coder100
  1. to check if a key is in a dictionary, use the in keyword
  1. to join 2 dictionaries together, use a for loop!
CosmicBear