Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to implement Desktop Student Information Management Program with Python

2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly shows you "Python how to achieve desktop student information management program", the content is easy to understand, clear, hope to help you solve your doubts, the following let Xiaobian lead you to study and learn "Python how to achieve desktop student information management program" this article.

The most basic version, suitable for zero foundation, but no interface.

Students = [{'name':' Zhang San', 'chinese': 60,' math': 60, 'english': 60}, {' name':'Li Si', 'chinese': 60,' math': 60, 'english': 60}, {' name': 'Wang Wu', 'chinese': 60,' math': 60, 'english': 60} ] while True: print (msg) action = input ('Please select the operation you want to do:') # action = 12 3 450 print ('selected operation:\ tasking, action) if action = = 1: print (' 1. New Student Information') # New Student Information name = input ('Please enter name:') chinese = int (input ('Please enter Chinese score:') math = int (input ('Please enter Math score:) english = int (input (' Please enter English score:)) # do you want to enter the total score? New_student = {'name': name,' chinese': chinese, 'math': math,' english': english} # New student information is available, how to add students.append (new_student) elif action = = 2: print ('2. Show all information') # get the information of all students print ('name, Chinese, mathematics and English total score') for student in students: # print (student) print (student ['name'] +''+ Str (student ['chinese']) +' + str (student ['math']) +' + str (student ['english']) +''+ str (student ['chinese'] + student [' math'] + student ['english'])) elif action = 3: print (' 3. Query student information') name = input ('Please enter the name of the student to be queried:') # then print the student found. If it is not found, print the student does not exist flag = False # define a variable record whether student # 1 has been found. Traversing all the students for student in students: # print (student) # 2. If you enter the same student name as the student name in the code, you will find if student ['name'] = = name: # 3. Then print the student print ('name Chinese math English total score') print (student ['name'] +''+ student ['chinese'] +''+) Student ['math'] +''+ student ['english'] +''+ student ['chinese'] + student [' math'] + student ['english']) flag = True # Mark it # if you don't find it, print it. Member does not exist if not flag: # 4. Print if not found, this student does not exist # should be to find all the students did not find before printing print ('this student does not exist') # the ability of a programmer is proportional to the code he has typed elif action = = 4: print ('4. Delete student information') # enter the name of the student to be deleted name = input ('Please enter the name of the student to be deleted:') # find the student to be deleted flag = False for student in students: if student ['name'] = = name: # delete the student directly after finding it # how to delete the element students.remove (student) print (student ['name'] +' Student deleted successfully') flag = True if not flag: print ('this student does not exist') from the list Cannot delete') elif action = = 5: print ('5. Modify student information') name = input ('Please enter the name of the student to be modified:') # find the student to be deleted flag = False for student in students: if student ['name'] = = name: # after you find the student, you can modify the print (' (enter blank and do not fix it) )') # input input may be empty name = input ('Please re-enter your name:') chinese = input ('Please re-enter your Chinese score:') math = input ('Please re-enter your math grade:') english = input ('Please re-enter your English grade:') # if name enters content Let's copy if name: # true false student ['name'] = name # we need to convert the string to a number if chinese: student [' chinese'] = int (chinese) if math: student ['math'] = Int (math) if english: student ['english'] = int (english) # Building a knowledge system requires little by little accumulation flag = True if not flag: print (' this student does not exist Cannot modify') elif action = = 6: # conditional query total score language + data # >

< = print() elif action == '0': print('0. 退出系统 欢迎下次光临') break else: print('请选择正确的操作') 这种的话交个差没得问题,就是颜值不太高,全靠我的pycharm背景撑住了牌面? 然后给你们展示另外一个超级全面的版本,做外包都够了。 登录界面 录入界面 录入一个张三 查询系统 如果录入后没出现的话刷新一下就好了 删除页面 刚刚才把李四删除,李四因为成绩不好被我开除了?

Information modification

Zhang Sanpianke, let's change his grades, or he will go to study law.

These are all the contents of the article "how to implement the Desktop Student Information Management Program with Python". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report