#Melissa Hensley #CIS 122 #Chapter 6 Exercise 7 #Test Average and Grade def grade(score1, score2, score3, score4, score5): letter=[score1, score2, score3, score4, score5] if letter > 90: print "A" elif letter > 80: print "B" elif letter > 70: print "C" elif letter > 60: print "D" elif letter < 59: print "F" return grade def average(): score1=int(input("Enter your first test score: ")) score2=int(input("Enter your second test score: ")) score3=int(input("Enter your third test score: ")) score4=int(input("Enter your fourth test score: ")) score5=int(input("Enter your fifth test score: ")) print grade average()
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