473,396 Members | 1,779 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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.
Expand|Select|Wrap|Line Numbers
  1. telebok = {}
  2. while True:
  3.     val = raw_input("telebok> ")
  4.     split_val = val.split()
  5.  
  6.     if split_val[0] == "quit":
  7.         break
  8.  
  9.     elif split_val[0] == "add":
  10.         print "add"
  11.  
  12.     elif split_val[0] == "lookup":
  13.         print "lookup"
  14.  
  15.     elif split_val[0] == "alias":
  16.         print "alias"
  17.  
  18.     elif split_val[0] == "change":
  19.         print "change"
  20.  
Oct 13 '08 #1
1 3489
numberwhun
3,509 Expert Mod 2GB
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
Oct 13 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Kelly Mandrake | last post by:
I have been learning about STL's map class. I see that I can clear a hashmap by useing the method clear, however I decided to try to clear the hash with a for loop. Since erase can take an...
2
by: Tom | last post by:
1. I drag the sqlDataAdapter and sqlConnection from the tool bar to the web form. It creates automatically: protected System.Data.SqlClient.SqlDataAdapter sqlDataAdapter1; protected...
6
by: Doug Robertson | last post by:
VB.net 2000 Windows XP only I have an app that (among other things) allows the user to create a new "phonebook" entry. API is defined this way: Declare Auto Function RasCreate Lib...
1
by: HW | last post by:
Hi all considering a webapplication where its datasource is AD - could someone please direct me how to connect to the AD ? some links would be nice...
7
by: E B via SQLMonster.com | last post by:
Hi All!! I need to build small phone book db. There are phone numbers and name (to whom phone belong) There are distribution lists that holds phone numbers and also can hold another lists....
2
by: Steven Munlo | last post by:
Hi, until now, I was happy with my little html table for my addresses. Now, I have some hundred but still don't want to program php/mysql. I would be nice to choose between address tables sorted...
4
by: DDCane | last post by:
i need to make a dictionary that works as a telephone book. this is what needs to happen when i type in the following: add name number – it adds the name and number to the phonebook lookup name...
12
by: ShaneMcD | last post by:
Hi, I'm doing a fairly basic Java course, and I have to design a very simple phone book programme which will take a small number of phone entries (the number can be predefined so I can use arrays...
1
by: jerry | last post by:
i have written a simple phonebook program,i'll show you some of the codes,the program's head file is member.h . i suppose the head file works well.so i don't post it. here's the clips of main...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.