色综合图-色综合图片-色综合图片二区150p-色综合图区-玖玖国产精品视频-玖玖香蕉视频

您的位置:首頁技術(shù)文章
文章詳情頁

Python實(shí)現(xiàn)一個(gè)簡單的畢業(yè)生信息管理系統(tǒng)的示例代碼

瀏覽:5日期:2022-07-27 17:06:35

寫在前面:

從昨晚的夢里回憶起數(shù)據(jù)管理的作業(yè):實(shí)現(xiàn)一個(gè)自己的選題----畢業(yè)生信息管理系統(tǒng),實(shí)現(xiàn)學(xué)生個(gè)人信息基本的增刪改查,我想了想前段時(shí)間剛學(xué)習(xí)的列表,這個(gè)簡單啊 ,設(shè)計(jì)一個(gè)學(xué)生信息列表,然后列表里面再存每個(gè)學(xué)生詳細(xì)信息的列表,然后來實(shí)現(xiàn)一個(gè)基本的增刪查改,這個(gè)不難啊!直接開始擼代碼!

Python實(shí)現(xiàn)一個(gè)簡單的畢業(yè)生信息管理系統(tǒng)的示例代碼

上代碼!

def Menu():##菜單主界面 print(’*’*22) print('* 查看畢業(yè)生列表輸入: 1 *') print('* 添加畢業(yè)生信息輸入: 2 *') print('* 修改畢業(yè)生信息輸入: 3 *') print('* 刪除畢業(yè)生信息輸入: 4 *') print('* 退出系統(tǒng)請輸入 0 *') print(’*’*22)def CheckIdisRight(StudentList,id):##檢查學(xué)號是否在列表中 for i in range(0, len(StudentList)): if((id in StudentList[i])==True): return True return Falsedef PrintStudentList(StudentList):#打印學(xué)生信息列表 for i in range(0, len(StudentList)): print(StudentList[i])def AddStudent(StudentList):##添加學(xué)生信息 number = int((input('請輸入學(xué)號: '))) if(number<1000000000 and CheckIdisRight(StudentList,number)==False):##學(xué)號判斷 print('學(xué)號輸入錯(cuò)誤&學(xué)號已存在!請重新輸入:') number = (input('請輸入學(xué)號: ')) name = input('請輸入你的名字:') tell = input('請輸入你的電話:') if(len(tell)!=11): print('請輸入正確的電話號碼(11)位: ') tell = input() college = input('請輸入你的學(xué)院名稱:') grade = input('請輸入你的年級:') isjob = int(input('是否就業(yè)?:是填 1 否則填0: ')) if(isjob == 1): company = input('請輸入你公司的名稱:') else: company = 0 arry = [number, name, tell, college, grade, isjob, company] StudentList.append(arry)##將新建的學(xué)生信息進(jìn)行插入 PrintStudentList(StudentList)##打印學(xué)生信息列表def StudentPersonalMsg():##修改信息界面選擇 print(’*’ * 22) print('* 修改姓名請輸入: 1 *') print('* 修改電話號碼請輸入: 2 *') print('* 修改是否就業(yè)請輸入: 3 *') print('* 修改就業(yè)公司請輸入: 4 *') print('* 退出修改請輸入: 0 *') print(’*’ * 22)def ChangeStudent(StudentList):##修改學(xué)生信息模塊 ##默認(rèn)學(xué)號 年級 等信息不可修改 def changename(StudentList, arry, i):#修改姓名 print(arry) name = input('請輸入修改后的名字:') StudentList[i][1] = name print('修改后為:') PrintStudentList(StudentList) def changetell(StudentList, arry, i):#修改電話號碼 print(arry) tell = input('請輸入修改后的電話號碼:') StudentList[i][2] = tell print('修改后為:') PrintStudentList(StudentList) def changeisgob(StudentList, arry, i):#修改是否就業(yè)情況 print(arry) isgob = int(input('請輸入修改后的 是否工作:')) StudentList[i][5] = isgob print('修改后為:') PrintStudentList(StudentList) def changcompany(StudentList, arry, i):#修改就業(yè)公司信息 print(arry) company = input('請輸入修改后的公司為:') StudentList[i][6] = company print('修改后為:') PrintStudentList(StudentList) print('請輸入要修改的學(xué)生的學(xué)號:') id = int(input()) i=1 if((CheckIdisRight(StudentList,id))==False):##判斷學(xué)號是否存在 print('學(xué)號不存在!') if(CheckIdisRight(StudentList,id)==True): while (i < len(StudentList)):#通過循環(huán)找到該學(xué)生的信息列表 if (StudentList[i][0] == id):StudentPersonalMsg()##顯示出修改的菜單選項(xiàng)while (1): a = int(input('請輸入: ')) while (a): if (a == 1): ##姓名修改 changename(StudentList, StudentList[i], i) break if (a == 2): ##電話號碼修改 changetell(StudentList, StudentList[i], i) break if (a == 3): ##是否就業(yè)狀態(tài)修改 changeisgob(StudentList, StudentList[i], i) break if (a == 4 and StudentList[i][5] == 1): ##就業(yè)公司修改 changcompany(StudentList, StudentList[i], i) break if (a == 4 and StudentList[i][5] == 0): print('學(xué)生尚未就業(yè),請先修改是否就業(yè)信息!') break if (a == 0): ##按0 退出修改信息功能 break##返回到主界面的菜單選項(xiàng)break i = i + 1def DeleteStudent(StudentList):##刪除學(xué)生信息 print('請輸入要刪除的學(xué)生的學(xué)號:輸入0退出!') id = int(input()) i = 1 if((CheckIdisRight(StudentList,id))==False): print('學(xué)號不存在!') if(CheckIdisRight(StudentList,id)==True): ##同樣先判斷學(xué)號學(xué)號是否存在 while (i < len(StudentList)): if (StudentList[i][0] == id): del StudentList[i] print('刪除成功!') break if (id == 0): break i = i + 1 PrintStudentList(StudentList)#打印學(xué)生信息列表def main(): Menu() StudentInfo = [’學(xué)號’, ’姓名’, ’電話’, ’學(xué)院’, ’年級’, ’是否就業(yè)’, '就業(yè)公司'] ##先默認(rèn)插入一個(gè)用于顯示的列表的列表 StudentList = [StudentInfo] while(1): a = int(input('請輸入: ')) while(a): if(a==1):PrintStudentList(StudentList)Menu()break if(a==2):AddStudent(StudentList)Menu()break if(a==3):ChangeStudent(StudentList)Menu()break if(a==4):DeleteStudent(StudentList)Menu()break if (a == 0):##按0退出進(jìn)程 exit()main()

再看測試效果圖:

主界面

Python實(shí)現(xiàn)一個(gè)簡單的畢業(yè)生信息管理系統(tǒng)的示例代碼

1.查看畢業(yè)學(xué)生信息列表

Python實(shí)現(xiàn)一個(gè)簡單的畢業(yè)生信息管理系統(tǒng)的示例代碼

Python實(shí)現(xiàn)一個(gè)簡單的畢業(yè)生信息管理系統(tǒng)的示例代碼

2.增加畢業(yè)學(xué)生信息

Python實(shí)現(xiàn)一個(gè)簡單的畢業(yè)生信息管理系統(tǒng)的示例代碼

3.修改畢業(yè)學(xué)生信息

Python實(shí)現(xiàn)一個(gè)簡單的畢業(yè)生信息管理系統(tǒng)的示例代碼

Python實(shí)現(xiàn)一個(gè)簡單的畢業(yè)生信息管理系統(tǒng)的示例代碼

Python實(shí)現(xiàn)一個(gè)簡單的畢業(yè)生信息管理系統(tǒng)的示例代碼

4.刪除畢業(yè)生信息

Python實(shí)現(xiàn)一個(gè)簡單的畢業(yè)生信息管理系統(tǒng)的示例代碼

大致實(shí)現(xiàn)了一下功能,但是萬萬沒想到!!!

Python實(shí)現(xiàn)一個(gè)簡單的畢業(yè)生信息管理系統(tǒng)的示例代碼

Python實(shí)現(xiàn)一個(gè)簡單的畢業(yè)生信息管理系統(tǒng)的示例代碼

一時(shí)語塞的我 :我 *******(這就是不看文檔的后果吧!)

算了算了,再重寫一個(gè)!

到此這篇關(guān)于Python實(shí)現(xiàn)一個(gè)簡單的畢業(yè)生信息管理系統(tǒng)的示例代碼的文章就介紹到這了,更多相關(guān)Python 畢業(yè)生信息管理系統(tǒng)內(nèi)容請搜索好吧啦網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持好吧啦網(wǎng)!

標(biāo)簽: Python 編程
相關(guān)文章:
主站蜘蛛池模板: 国产亚洲欧美ai在线看片 | 国产欧美日韩不卡在线播放在线 | 欧洲成人全免费视频网站 | 国产精品一区二区四区 | 最全精品自拍视频在线 | 理论片我不卡在线观看 | 亚洲精品成人久久 | 亚洲一级毛片在线观播放 | 久草在线视频网 | 久久久99精品免费观看精品 | 日本wwww视频 | 欧美性69 | 欧美三级在线视频 | 一色屋色费精品视频在线观看 | 日韩精品麻豆 | 欧美一级大黄特黄毛片视频 | 色午夜在线 | 性做久久久久久久免费观看 | 各种偷拍盗摄视频在线观看 | 国产精品91在线 | 一级成人黄色片 | 欧美亚洲国产精品久久久 | 日本在线免费视频 | 99福利资源久久福利资源 | 亚洲国产欧美精品一区二区三区 | aaa免费看 | 国模偷拍在线观看免费视频 | 亚洲在线观看网站 | a级高清观看视频在线看 | 理论片日韩 | 国产一区二区三区精品视频 | 97天天干 | 国产午夜爽爽窝窝在线观看 | 国产精选一区 | 一级黄色毛片免费看 | 色综合日韩 | 免费 欧美 自拍 在线观看 | 成年女人在线观看片免费视频 | 老头做爰xxxx视频 | 欧美激情国内自拍偷 | 波多野一区二区 |