## Aaron Schaffer ## def calcAverage(scores): return scores/5 score1 = int(input("Enter the first test score: ")) print(score1) score2 = int(input("Enter the second test score: ")) print(score2) score3 = int(input("Enter the third test score: ")) print(score3) score4 = int(input("Enter the fourth test score: ")) print(score4) score5 = int(input("Enter the fifth test score: ")) print(score5) scores = (score1 + score2 + score3 + score4 + score5) def determineGrade(): if (calcAverage(scores)>89): return ("A") elif (calcAverage(scores)>79 and calcAverage(scores)<90): return ("B") elif (calcAverage(scores)>69 and calcAverage(scores)<80): return ("C") elif (calcAverage(scores)>59 and calcAverage(scores)<70): return ("D") elif (calcAverage(scores)<60): return ("F") print("The average score is: {} and the letter grade is {}.".format(calcAverage(scores), determineGrade()))
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question