title: Who's your daddy python program
body: <hr>
  
  <p>I have been having trouble trying to delete an element or pair from my dictionary. It is supposed to delete both the father and the son when you type in the son's name, but it always produces this error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:\Users\jam7733\Desktop\whos ur daddy.py", line 23, in &lt;module&gt;
      daddy()
    File "C:\Users\jam7733\Desktop\whos ur daddy.py", line 20, in daddy
      if del_son in fathers:
  TypeError: unhashable type: 'list'
  </code></pre>
  
  <hr>
  
  <p>here is the code i have:</p>
  
  <pre><code>def daddy():
      fathers = {'johnny':'john Dupuis','alex':'jordan belfort','henry':'daniel plainview','mike':'brian cranston','max':'fred man','benny':'nick flick','billy':'robert kardashian'}
      choice = raw_input("do you want to: a)add a father-son pair,b)delete a pair, c)replace a pair,d)look up father-son pair, or e)look for grandfather")
      if choice == 'd':
          name = raw_input("what is the first name of the child? ")
          if name in fathers:
              print name,"is the child of",fathers[name]
          else:
              print "sorry, we do not have this name listed, please try again."
              daddy()
      if choice == "a":
          new_dad = raw_input("what is the name of the new dad?")
          new_son = raw_input("what is the name of the son?")
          fathers[new_dad]=new_son
      if choice == "b":
          print"Here are the names of the fathers that you can delete: "
          print fathers
          del_son = raw_input("what father/son pair do you want to delete?(type first name of son").split(" ")
          if del_son in fathers:
              del fathers[del_son]
  
  daddy()
  </code></pre>