Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- user_score = float(input('Enter your grade:'))
- def return_grade(user_input):
- try:
- if user_score > 1.0 or user_score < 0.0 :
- return ('Please enter a number between 0.0 and 1.0')
- elif user_score >= 0.9 :
- return 'A'
- elif user_score >= 0.8 :
- return 'B'
- elif user_score >= 0.7 :
- return 'C'
- elif user_score >= 0.6 :
- return 'D'
- elif user_score < 0.6 :
- return 'F'
- except VelueError:
- print('Please enter a number')
- print(return_grade(user_input))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement