categories=int(raw_input("number of grading categories:")) print categories def what_grade_do_I_need(x): total=0 x=categories progression=0 while progression<x: grade= int(raw_input("what grade did you get?")) percent=int(raw_input("what percent of the class is that worth?")) weight=grade*percent total+=weight progression+=1 actual_total=total*.01 a= int(raw_input("what grade do you want?")) b=int(raw_input("what percentage is the final worth?")) goodgrade= (a-actual_total)/b return goodgrade*100 print what_grade_do_I_need(categories)
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