求python大神,题目是write a program to keep track of conference attendeesfor each attendee,your program should keep track of name,company,state,mail.it should allow user to do things :add a new attendee,display info on a attendee,delete an atten

来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/26 00:33:13
求python大神,题目是writeaprogramtokeeptrackofconferenceattendeesforeachattendee,yourprogramshouldkeeptrack

求python大神,题目是write a program to keep track of conference attendeesfor each attendee,your program should keep track of name,company,state,mail.it should allow user to do things :add a new attendee,display info on a attendee,delete an atten
求python大神,题目是write a program to keep track of conference attendees
for each attendee,your program should keep track of name,company,state,mail.it should allow user to do things :add a new attendee,display info on a attendee,delete an attendee ,list the name and mail of all attendees,and list the name and mail from a given state.the attendee should be stored in a file and loaded when the program starts.这个不用界面也可以吗?思路是怎么样的.因为是初学者,所以希望能帮个忙

求python大神,题目是write a program to keep track of conference attendeesfor each attendee,your program should keep track of name,company,state,mail.it should allow user to do things :add a new attendee,display info on a attendee,delete an atten
#!sur/bin/env python
'''
Copyright (C)2012
@authored by tws
last modefied at 2012/12/2 23:52
'''
import pickle,os
data = []
filename = os.getcwd() + os.path.sep + 'data' #文件保存路径
def main():
global data #存放数据的列表
data = load()
string = '''
(A)dd new
(D)ispaly
(R)emove
(S)how all
(L)ist
(Q)uit
'''
while True:
action = input(string)
if action in 'Aa':
add()
elif action in 'Dd':
Display()
elif action in 'Rr':
Remove()
elif action in 'Ss':
Show()
elif action in 'Ll':
List()
elif action in 'Qq':
save()
break
else:
print('error,please input correct instruction')
def add():
info = {}
name = input('Input name\n')
company = input('Input company\n')
state = input('Input State\n')
email = input('Input E-mail Address\n')
info['name'] = name
info['company'] = company
info['state'] = state
info['email'] = email
data.append(info)#添加一个人的信息到数据结构
def Display():
msg = input('which person would want to know(name)?\n')
exist = False #是否存在此人
for item in data:
if item['name'] == msg:
printdata(item)
exist = True
if not exist:
print('no such person!')
def Remove():
msg = input('which person would want to delete(by name)?\n')
exist = False #是否存在此人
for index,item in enumerate(data):
if item['name'] == msg:
printdata(item)
exist = True
while True:
info = input('is this person?(Y/N)\n')
if info in "Yy":
del(data[index])
print('Delete Success!')
break
elif info in 'Nn':
break
else:
print('please input correct inseruction')
if not exist:
print('no such person!')
def Show():
for item in data:
printdata(item)
def List():#自己实现其他的功能
pass
def other():
pass
def save():
fp = open(filename,'wb') #存好数据
pickle.dump(data,fp)
def load():
try:
fp = open(filename,'rb')
return pickle.load(fp)
except:
return []
def printdata(item):
print('name:' + item['name'] + '||' + 'company:' + item['company'] + '||'
+ 'state:' + item['state'] + '||' + 'email' + item['email'] + '\n')
if __name__ == '__main__':
main()

求python大神,题目是write a program to keep track of conference attendeesfor each attendee,your program should keep track of name,company,state,mail.it should allow user to do things :add a new attendee,display info on a attendee,delete an atten Write a about your self这个题目的意思是:写写你自己,用英文写,大于或等于100字,求大神解.急! 可以问一道关于python的题吗?题目是write a program to keep track of conference attendeesfor each attendee,your program should keep track of name,company,state,mail.it should allow user to do things :add a new attendee,display info on a att 求一篇英语作文,中学水平,题目是:please write a letter to your teacher in junior school 拜托了! python输入若干个数,输入stop,停止,并找出最大的数,最小的数,和所有数的和.输入的数可以是5个,可以是10个,可以是100个,也可以更多.求大神告诉我怎么能输入任意的数,我只会a=int(raw_input())这 有道PYTHON题求解答 求大神分析化学题目 物理题目 求大神 化学题目 求大神 数学题目~~~求大神! 速求一篇外贸英语函电的考试作文啊!写作题目是:1.Write a counter-offer letter和2.Write a letter of establishing business relations有木有英语高手啊!?帮帮忙啊!. 求题目是write about your own daily routine?的作文 c+=a-=a*=a求大神帮助c+=a-=a*=a 已知a=12是整型.这是c语言题目. 求大神帮忙翻译一下作文题, Write about a time when you wer求大神帮忙翻译一下作文题, Write about a time when you were deceived by a person's outward appearance. 初二英语作文题目是Write about a person you admire.要求不少于六十个词 初二英语作文题目是Write about a person you admire 题目是write a story about your dinosaur 50字以上的英文短文加翻译 翻译器去死! 求大神帮忙翻译题目! 英语数学题! 谢谢!find other fractions that do not repeat. write out the fraction and the decimal expansion