def calcAverage(test1,test2,test3,test4,test5): return (test1+test2+test3+test4+test5)/5 def determineGrade(scoredTest): if scoredTest <=59: print "Your grade: F" elif scoredTest <=69: print "Your grade: D" elif scoredTest <=79: print "Your grade: C" elif scoredTest <=89: print "Your grade: B" elif scoredTest <=100: print "Your grade: A" test1=input("Please enter the test score: ") determineGrade(test1) test2=input("Please enter the test score: ") determineGrade(test2) test3=input("Please enter the test score: ") determineGrade(test3) test4=input("Please enter the test score: ") determineGrade(test4) test5=input("Please enter the test score: ") determineGrade(test5) print 'Your test average is: {}'.format(calcAverage(test1,test2,test3,test4,test5))
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