cs/Practical File/question_10.py
Neil Revin cc8b0efe94
feat: add practical file projects
Signed-off-by: Neil <neil@willofsteel.me>
2025-06-24 02:28:22 +05:30

29 lines
569 B
Python

"""
Question: Write a Python program to accept marks of a student and print the grade according to the given criteria:
- Marks ≥ 90: A
- Marks ≥ 80: B
- Marks ≥ 70: C
- Marks ≥ 60: D
- Otherwise: Fail
"""
def main(marks: int) -> None:
if marks >= 90:
grade = 'A'
elif marks >= 80:
grade = 'B'
elif marks >= 70:
grade = 'C'
elif marks >= 60:
grade = 'D'
else:
grade = 'Fail'
print(f"Grade: {grade}")
if __name__ == '__main__':
main(95)
main(85)
main(75)
main(65)
main(55)