Program untuk mengilustrasikan penggunaan rata -rata pernyataan bersarang di python grade> = 80 dan di atas a> = 70 dan <80 b> = 60 dan <70 c> = 50 dan <60 d sebaliknya
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: "))
sub5=int(input("Enter marks of the fifth subject: "))
avg=(sub1+sub2+sub3+sub4+sub4)/5
if(avg>=80&avg<90):
print("Grade: A")
elif(avg>=70&avg<80):
print("Grade: B")
elif(avg>=60&avg<70):
print("Grade: c")
elif(avg>=50&avg<60):
print("grade: D")
else:
print("Grade: e")
Rehana Parveen