why bother
people = ((data["name"],data["number"]) for data in json.loads(some_list)[::-1])
phoneBook = dict(people)
this will work in reverse order through the list, so the first occurrence of the name will be the one stored in the dictionary
verification takes more time than just pasting it ... even if it ends with what is written
, ,
, else forloop, ,
, , ... ,
phoneBook = dict()
def addNumber(name, number):
for i in phoneBook:
if i == name:
print 'error'
return
phoneBook[name] = number
addNumber("james",56)
addNumber("Tommy",26)
addNumber("james",77)