Computer Science, asked by kumarsinghrishab41, 4 months ago

Write a program in Python to read grade from the user if grade is ‘A’ then display “Excellent”, if grade is ‘B’ then display “Very Good”, if grade is ‘C’ then display “Good”, if grade is ‘D’ then display “Satisfactory”, else display “Invalid Grade”.. ​

Answers

Answered by allysia
50

Language:

Python

Program:

a=input("Enter the grade: ")

if a=="A":

   print("Excellent")

elif a=="B":

   print("Very Good")

elif a=="C":

   print("Good")

elif a=="D":

   print("Satisfactory")

else:

  print("Invalid Grade")

Output:

Enter the grade: D

Satisfactory

Explanation:

  • If - elif-else statements checks the condition and display the output as per condition.  

Attachments:

Attachments:
Similar questions