print "\tWelcome to the grading program.\n" good = 0 fail = 0 students = 0 totalscore = 0 while student == "y" name = raw_input("What is your name; ") grade = int(raw_input("What is your grade (0-100): ")) students += 1 totalscore = totalscore + grade if grade > 90: good += 1 print "You are doing extremely well." elif grade < 60: fail += 1 print "You are in jeopardy of failing." student = raw_input("Are there any more students in your class (y/n): ") average = totalscore /= students print "There are" , students , "in this class." print "There are" , good , "students doing extremely well and there are" , fail , "students who are in jeopardy\ of failing." print "The average score of the class is" , average , "." print raw_input("Press Enter to Exit Program")
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