userInput = input("Enter something:") try: val = float(userInput) except ValueError: print("That's not an int!") else: userInput = float(userInput) if userInput <=100 and userInput >=0: if userInput >= 85: print ("You got 4.0 GPA, excellent!") elif userInput >= 80: print ("You got 3.7 GPA, pretty good!") elif userInput >= 75: print ("You got 3.4 GPA, cool!") elif userInput < 75 and userInput>50: print("Your GPA is somewhere around 3.0 to 1.0") else: print("You're passed! Don't sweat it") else: print("The marks entered are invalid.")
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