Grade System
Assign a letter grade from a percentage. Students separate reading a percentage from averaging marks and trace the same descending cutoff policy at boundaries.
1# Take percentage2percentage = float(input("Enter percentage: "))34# Determine grade5if percentage >= 90:6 grade = 'A'7elif percentage >= 80:8 grade = 'B'9elif percentage >= 70:10 grade = 'C'11elif percentage >= 60:12 grade = 'D'13else:14 grade = 'F'1516print(f"Grade: {grade}")
Output
Enter percentage: 85 Grade: B
In this one
- Read an existing percentage
- Apply descending bands
- Separate grading from averaging
How it works
- 1
Convert percentage input to float.
- 2
Test cutoffs ninety, eighty, seventy, then sixty.
- 3
Store and print the first matching grade or F.
Edge cases
What grade does 80 receive?
What grade does 80 receive?
B.
Does this calculate the percentage from marks?
Does this calculate the percentage from marks?
No. It reads the percentage directly.
What's going on
This program receives a percentage already calculated elsewhere. It assigns grade through ordered comparisons rather than reading individual subject marks.
Ninety and above gets A; later cutoffs cover B, C, and D before the final F. The first successful test ends the chain. The prompt does not validate a zero-to-one-hundred range, so impossible percentages still receive labels under the same numeric rules.
What grade does 80 receive? B.
Does this calculate the percentage from marks? No. It reads the percentage directly.
Quiz
Tap an option. The answer stays hidden until you pick.
Question 1
Why test ninety before sixty?
Pick an answer to check it.
Question 2
What grade does 80 receive?
Pick an answer to check it.
Questions people ask
What grade does 80 receive?
B.
Does this calculate the percentage from marks?
No. It reads the percentage directly.
Why test ninety before sixty?
A high percentage also exceeds lower cutoffs.
๐Related Content
- ๐
Phase 6 - Learn Concepts
Review Phase 6 concepts and explanations
- ๐
Phase 6 - Quiz
Test your Phase 6 understanding with quiz questions
- ๐ป
Phase 6 - All Practice Problems
Explore all practice problems for Phase 6
- ๐
Master Your Logic Building - Complete Course
Browse all phases and tutorials
- ๐ง
Logic Building Overview
Learn about the complete logic building curriculum