Python Program to find student Grade in Examination by suing if-elif-else and use of logical and operator

Python Program to find student Grade in Examination by suing if-elif-else and use of logical and operator 

s1=int(input("Enter Python marks:"))

s2=int(input("Enter PHP marks:"))

s3=int(input("Enter DBMS marks:"))

s4=int(input("Enter COA marks:"))

s5=int(input("Enter C programming marks:"))

total_marks=s1+s2+s3+s4+s5

p=(100*total_marks)/500

if p>=70:

    print("You have got distinction")

elif p>=60 and p<70:

    print("You have got first class")

elif p>=50 and p<60:

    print("You have got second class")

elif p>=40 and p<50:

    print("You just pass")

else: 

    print("Sorry you are fail in examination")


Output:

Enter Python marks:30

Enter PHP marks:12

Enter DBMS marks:13

Enter COA marks:24

Enter C programming marks:25

Sorry you are fail in examination

टिप्पणी पोस्ट करा

0 टिप्पण्या