亚洲精品久久久中文字幕-亚洲精品久久片久久-亚洲精品久久青草-亚洲精品久久婷婷爱久久婷婷-亚洲精品久久午夜香蕉

您的位置:首頁技術文章
文章詳情頁

Python實現一個簡單的畢業生信息管理系統的示例代碼

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

寫在前面:

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

Python實現一個簡單的畢業生信息管理系統的示例代碼

上代碼!

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

再看測試效果圖:

主界面

Python實現一個簡單的畢業生信息管理系統的示例代碼

1.查看畢業學生信息列表

Python實現一個簡單的畢業生信息管理系統的示例代碼

Python實現一個簡單的畢業生信息管理系統的示例代碼

2.增加畢業學生信息

Python實現一個簡單的畢業生信息管理系統的示例代碼

3.修改畢業學生信息

Python實現一個簡單的畢業生信息管理系統的示例代碼

Python實現一個簡單的畢業生信息管理系統的示例代碼

Python實現一個簡單的畢業生信息管理系統的示例代碼

4.刪除畢業生信息

Python實現一個簡單的畢業生信息管理系統的示例代碼

大致實現了一下功能,但是萬萬沒想到!!!

Python實現一個簡單的畢業生信息管理系統的示例代碼

Python實現一個簡單的畢業生信息管理系統的示例代碼

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

算了算了,再重寫一個!

到此這篇關于Python實現一個簡單的畢業生信息管理系統的示例代碼的文章就介紹到這了,更多相關Python 畢業生信息管理系統內容請搜索好吧啦網以前的文章或繼續瀏覽下面的相關文章希望大家以后多多支持好吧啦網!

標簽: Python 編程
相關文章:
主站蜘蛛池模板: 日韩一级黄色影片 | aaa在线 | 亚洲精品欧美日本中文字幕 | 久久中文字幕综合不卡一二区 | 欧美伦理一区二区三区 | 免费观看国产精品 | 在线观看一区 | 久久99热这里只频精品6中文字幕 | 国产成人h片视频在线观看 国产成人lu在线视频 | 好爽好黄的视频 | 国模大胆偷拍在线视频 | 国产免费久久精品99 | 成人伊人网 | 欧美全免费aaaaaa特黄在线 | 西川结衣在线精品视频 | 丝袜乱小说 | 婷婷丁香在线 | 全部费免一级毛片不收费 | 在线播放 亚洲 | 欧洲一级鲁丝片免费 | 国产欧美日韩在线播放 | 亚洲精品国产成人中文 | 澳门久久| 欧美亚洲国产第一页草草 | 欧美久久一区二区三区 | 国产美女野外做爰 | 激情五月综合婷婷 | 日韩中文字幕久久久经典网 | 欧美一区二区三区男同 | 国产成人综合久久综合 | 国产精品欧美亚洲日本综合 | 亚洲精品视频二区 | 91短视频在线观看免费 | 五月天婷婷久久 | 哪里可以看黄色播放免费 | 国产成人亚洲精品久久 | 免费一级特黄a | 香港毛片免费观看 | 国产成人精品精品欧美 | 在线日韩不卡 | 看一级黄色大片 |