国产成人精品久久免费动漫-国产成人精品天堂-国产成人精品区在线观看-国产成人精品日本-a级毛片无码免费真人-a级毛片毛片免费观看久潮喷

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

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

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

寫在前面:

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

Python實現(xiàn)一個簡單的畢業(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):##檢查學號是否在列表中 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('是否就業(yè)?:是填 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('* 修改是否就業(yè)請輸入: 3 *') print('* 修改就業(yè)公司請輸入: 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):#修改是否就業(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('請輸入要修改的學生的學號:') id = int(input()) i=1 if((CheckIdisRight(StudentList,id))==False):##判斷學號是否存在 print('學號不存在!') if(CheckIdisRight(StudentList,id)==True): while (i < len(StudentList)):#通過循環(huán)找到該學生的信息列表 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): ##是否就業(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('學生尚未就業(yè),請先修改是否就業(yè)信息!') 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 = [’學號’, ’姓名’, ’電話’, ’學院’, ’年級’, ’是否就業(yè)’, '就業(yè)公司'] ##先默認插入一個用于顯示的列表的列表 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實現(xiàn)一個簡單的畢業(yè)生信息管理系統(tǒng)的示例代碼

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

算了算了,再重寫一個!

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

標簽: Python 編程
相關文章:
主站蜘蛛池模板: 欧美色xx| 亚州免费一级毛片 | 日韩欧美国产精品第一页不卡 | 最新中文字幕乱码在线 | 欧美极品第1页专区 | 中国一级毛片在线观看 | 老鸭窝 国产 精品 91 | a级毛片高清免费视频 | 女人张开腿让男人捅视频 | 久久国产精品无码网站 | 国产成人精品免费视频大全办公室 | 美女很黄很黄是免费的·无遮挡网站 | 乱淫毛片 | 美女一级毛片免费看看 | 国产精品黄页网站在线播放免费 | 伊人网在线免费视频 | 一 级做人爱全视频在线看 一本不卡 | 国产手机在线小视频免费观看 | 泰国情欲片寂寞的寡妇在线观看 | 国产日韩欧美在线 | 日本免费一级视频 | 久久成人在线 | 欧美人牲囗毛片 | 亚洲成人国产精品 | 黄网国产| 永久精品免费影院在线观看网站 | 欧美成人www在线观看网页 | 在线观看日本亚洲一区 | 久久精品a| 中文字幕亚洲欧美 | 爱福利极品盛宴 | 波多野结衣在线观看3人 | 国内自拍视频在线播放 | 国产精品免费一级在线观看 | 国产只有精品 | 99久久精品国产综合一区 | 国内国外精品一区二区 | 亚洲男人的天堂久久香蕉 | 国产三级在线视频观看 | 中文字幕一区二区三区久久网站 | 日韩国产毛片 |