Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- grade = float(input())
- output = {2.00 <= grade <= 2.99: "Fail",
- 3.00 <= grade <= 3.49: "Poor",
- 3.50 <= grade <= 4.49: "Good",
- 4.50 <= grade <= 5.49: "Very Good",
- 5.50 <= grade <= 6.00: "Excellent"}
- def solve():
- if 2 <= grade <= 6:
- return output[True]
- print(solve())
- Или:
- grade = float(input())
- def solve():
- if 2 <= grade <= 6:
- return {2.00 <= grade <= 2.99: "Fail",
- 3.00 <= grade <= 3.49: "Poor",
- 3.50 <= grade <= 4.49: "Good",
- 4.50 <= grade <= 5.49: "Very Good",
- 5.50 <= grade <= 6.00: "Excellent"}[True]
- print(solve())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement