I need to create a phonebook with the help of dictionaries, classes and objects. It needs to add a user and a phone number, it needs to lookup a phone number with the help of the name, it needs to change the the name of the user that you choose but still make his old name searchable, like an alias and it needs to change the phone number of one person. The idea is that you type in a name and a phone number and then when you choose to do an alias on Tom the same person will have two names, like Tom a.k.a shadow. When you want to find his phone number you can use either the name Tom or shadow. If you change the phone number at for example Tom, shadow will get the same number because Tom and Shadow are the same.
Here's my start. Thanks in advance.
-
telebok = {}
-
while True:
-
val = raw_input("telebok> ")
-
split_val = val.split()
-
-
if split_val[0] == "quit":
-
break
-
-
elif split_val[0] == "add":
-
print "add"
-
-
elif split_val[0] == "lookup":
-
print "lookup"
-
-
elif split_val[0] == "alias":
-
print "alias"
-
-
elif split_val[0] == "change":
-
print "change"
-