name = raw_input("What is your name ?") print("Nice to meet you " + name + "!") age = raw_input("What is your age") print("So you are " + age + "!") year = raw_input("What year are you in ?") print("So you are also in year " + year + "!") (numEntered) = raw_input("What is your score out of 80 ?") numEntered=int(numEntered) if numEntered >= 0 and numEntered <= 80 : score = float(numEntered) percentage = score/80 * 100 print("The percentage is " , percentage) if int(numEntered) >= 0 and numEntered < 6: print("That tells us that you got a U in your GCSE mock!") elif int(numEntered) > 7 and numEntered < 13: print("That tells us that you got a G in your GSCE mock!") elif int(numEntered) > 14 and numEntered < 20: print("That tells us that you got a F in your GCSE mock!") elif int(numEntered) > 21 and numEntered < 28: print("That tells us that you got an E in your GCSE mock!") elif int(numEntered) > 29 and numEntered < 36: print("That tells us that you got a D in your GCSE mock!") elif int(numEntered) > 37 and numEntered < 44: print("That tells us that you got a C in your GCSE mock!") elif int(numEntered) > 45 and numEntered < 52: print("That tells us that you got a B in your GCSE mock!") elif int(numEntered) > 53 and numEntered < 60: print("That tells us that you got an A in your GCSE mock!") elif int(numEntered) > 61 and numEntered <= 80: print("That tells us that you got an A* in your GCSE mock!") else : print("Incorrect number! Try again!")
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