0

I have this example dictionary of names and their jobs

my_dict = {'al': 'sales', 'tony': 'engineer': 'fred': 'support'}

I would like to print the name (key) of the entry in the dictionary if the job title (value) is match in an if statement.

job = input("what is the job?: ")

if job in my_dict.values():

   "print the key that has that job as a value"

How to do it?

Chris Martin
  • 30,334
  • 10
  • 78
  • 137
FrankBud
  • 37
  • 7

0 Answers0