phonebook_dict = {
  'Alice': '703-493-1834',
  'Bob': '857-384-1234',
  'Elizabeth': '484-584-2923'
}

#Excercise 1
print(phonebook_dict['Alice'])
phonebook_dict['Kareem'] = '938-489-1234'
del phonebook_dict['Alice']
phonebook_dict['Bob'] = '968-345-2345'
print(phonebook_dict)

#Exercise 2
ramit = {
  'name': 'Ramit',
  'email': 'ramit@gmail.com',
  'interests': ['movies', 'tennis'],
  'friends': [
    {
      'name': 'Jasmine',
      'email': 'jasmine@yahoo.com',
      'interests': ['photography', 'tennis']
    },
    {
      'name': 'Jan',
      'email': 'jan@hotmail.com',
      'interests': ['movies', 'tv']
    }
  ]
}

print(ramit['email'])
print(ramit['interests'][0])
print(ramit['friends'][0]['email'])
print(ramit['friends'][1]['interests'][1])

#Letter Summary
def letter_histogram(word):
    word = word.lower()
    wList = list(set(word))
    wDict = {}
    for i in wList:
        wDict[i] = word.count(i)
    return wDict
    
print(letter_histogram('yelloW'))

#Word Summary
def word_histogram(sentence):
    sentence = sentence.lower()
    sList = sentence.split(" ")
    sDict = {}
    for x in sList:
        sDict[x] = sentence.count(x)
    return sDict
    
print(word_histogram('The dog ate the cat'))