Python Simple student performance management system

Source: Internet
Author: User

#!/usr/bin/env python#manage the grade of studentdefinit (date): Date=[[],[],[],[],[]]    returnDatedefStore (date): ID=raw_input ('Please your ID:') name=raw_input ('Please your name:') 中文版=raw_input ('Please your 中文版:') Math=raw_input ('Please your math:') Science=raw_input ('Your science:') date[0].append (ID) date[1].append (name) date[2].append (中文版) date[3].append (math) date[4].append (Science)defPrintone (date,key):Print "id:%s,name:%s,english:%s,math:%s,science:%s"% (date[0][key],date[1][key],date[2][key],date[3][key],date[4][key])defPrintbyid (date): number=-1Count=0 Key=raw_input ('Please enter your ID')     forIinchDate[0]:ifkey==I:number=I BreakCount+=1ifNumber==-1:        Print 'None'    Else: Printone (base,count)defprintbyname (date): number=-1Count=0 Countadd=[] Key=raw_input ('Please enter your name')     forIinchDate[1]:        ifi==Key:number=I Countadd.append (count) Count+=1ifNumber==-1:        Print 'None'    Else:         forJinchCountadd:printone (base,j)defAlterbyid (date): number=-1Count=0 Key=raw_input ('Please enter your ID')     forIinchDate[0]:ifkey==I:number=I BreakCount+=1ifNumber==-1:        Print 'None'    Else: date[1][count]=raw_input ('Please your name:') date[2][count]=raw_input ('Please your 中文版:') date[3][count]=raw_input ('Please your math:') date[4][count]=raw_input ('Your science:')defallprint (date): Count=Len (date[0])ifcount==0:Print'None'    Else:         forIinchRange (count): Printone (base,i)defDeletebyid (date): number=-1Count=0 Key=raw_input ('Please enter your ID')     forIinchDate[0]:ifkey==I:number=I BreakCount+=1ifNumber==-1:        Print 'None'    Else: Base[0].pop (count) base[1].pop (count) base[2].pop (count) base[3].pop (count) base[4].pop (count) base=[]base=Init (Base)Print" "S:storepd:printbyidpe:printbynameay:alterbyidap:allprintdd:deletebyidother:quit" " whileTrue:choose=raw_input ('Please choose a function:')    ifchoose=='s': Store (Base)elifchoose=='PD': Printbyid (Base)elifchoose=='PE': Printbyname (Base)elifchoose=='ay': Alterbyid (Base)elifchoose=='AP': Allprint (Base)elifchoose=='DD': Deletebyid (Base)Else:         Break

Python simple student performance management system

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.