phonebook

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cooolsson
    New Member
    • Oct 2008
    • 5

    phonebook

    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.
    Code:
    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"
    Last edited by numberwhun; Oct 13 '08, 09:24 PM. Reason: Please use code tags!
  • numberwhun
    Recognized Expert Moderator Specialist
    • May 2007
    • 3467

    #2
    Ok, you want to create a phone book in Python and you have even provided us a small bit of code. But, do you have a question? This is not a scripting service and we are not going to write it for you, but we will be happy to help you with things that aren't working when you get stuck. Why not try to code it then post your code here if you get stuck or have a question.

    Also, please use code tags whenever posting code into the forums. I have corrected your first posting.

    Regards,

    Jeff

    Comment

    Working...