cs/practical-file/answers/question_10.py

19 lines
448 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
"""
marks = float(input("Enter the marks of the student: "))
if marks >= 90:
print("Grade: A")
elif marks >= 80:
print("Grade: B")
elif marks >= 70:
print("Grade: C")
elif marks >= 60:
print("Grade: D")
else:
print("Grade: Fail")