InterviewSolution
Saved Bookmarks
| 1. |
Write a program in python to display the grade of student as per instructions given below: Marks Grade 85 to 100 A 61 to 84 B+ 41 to 60 B 30 to 40 C Below 30 Fail Note- if marks entered Greater than 100 will be treated as Wrong input |
|
Answer» d ANSWER:-Question:Write a program in Python to display the grade of a student as per the given instructions. Solution:Here comes the program. n=float(input("Enter your marks: "))if n < 0 or n > 100: print("Invalid Marks.")else: g="" if n>=85: g="A" elif n>=61: g="B+" elif n>=41: g="B" elif n>=30: g="C" else: g="Fail" print("Your grade: ",g)ALGORITHM:STARTAccept the marks. Check if the marks is valid or not. Calculate and display the grade as per the given condition. STOP.Refer to the attachment for OUTPUT ☑. |
|