Python program to determine students final grade and indicate whether it is passing or failing

preview_player
Показать описание
Question 3-Write a program to determine students final grade and indicate whether it is passing or failing. The final grade is calculated as the average of marks in four subjects.

Class 11 - First Python Assignment solution
#python #pythonprogram

👉Source code is given in the comment box💖💖

Guys if you also want that i solve your questions then comment me.

Asked by
Rashmi Singh
Рекомендации по теме
Комментарии
Автор

sub1=int(input("Enter marks of the first subject: "))
sub2=int(input("Enter marks of the second subject: "))
sub3=int(input("Enter marks of the third subject: "))
sub4=int(input("Enter marks of the fourth subject: "))

avg=(sub1+sub2+sub3+sub4)/4
print(avg)

if(avg>=90):
print("Grade: A Pass")
elif(avg>=80 and avg<90):
print("Grade: B Pass")
elif(avg>=70 and avg<80):
print("Grade: C Pass")
elif(avg>=60 and avg<70):
print("Grade: D Pass")
else:
print("Grade: F fail")

parvatcomputertechnology
Автор

what if the user enters an invalid value?
please explain

bhupeshgunda