Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def main():
- Numberofstudents=eval(input("How many students will enter grades today? "))
- Name=input("What is your frist and last name? ")
- numberofgrades=eval(input("How many grades do you want to enter? "))
- gradecount=0
- studentcount=1
- lowestgradelisty=[]
- while studentcount<=Numberofstudents:
- gradetotal=0
- while gradecount<numberofgrades:
- gradeforlisty=eval(input("Enter grade please: "))
- gradetotal=gradetotal+gradeforlisty
- gradecount=gradecount+1
- Numberofstudents=Numberofstudents-1
- studentcount=studentcount+1
- lowestgradelisty.extend(gradeforlisty)
- min(lowestgradelisty.extend(gradeforlisty))
- Drop=(min(lowestgradelisty.extend(gradeforlisty))), "is your lowest grade. do you want to drop it? Enter as yes or no: "
- if (Drop=="yes"):
- print(Name, "The new total of your grades is", gradetotal-min(lowestgradelisty.append(gradeforlisty)/gradecount))
- elif (Drop=="no"):
- print("the averages of the grades enetered is", gradetotal/gradecount)
- print(Name, "The average of the grades entered for is", gradetotal/gradecount)
- gradecount=0
- studentcount=1
Add Comment
Please, Sign In to add comment