Move python question files to 'questions' directory Move output files to 'outputs' directory Copy output files to 'questions' for ease of viewing Signed-off-by: Neil <neil@willofsteel.me>
39 lines
635 B
Plaintext
39 lines
635 B
Plaintext
Question 10:
|
|
Write a Python program to accept marks of a student and print the grade according to the given criteria:
|
|
|
|
Answer:
|
|
- 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)
|
|
|
|
Output:
|
|
Grade: A
|
|
Grade: B
|
|
Grade: C
|
|
Grade: D
|
|
Grade: Fail
|