Thursday, February 29, 2024

 First simple Project - Grade Generator using python with basic understanding of coding ( if , else , print statement ,basic maths)


Giving a grade like A+ , A- , B, C, D .... as per the student obtained in an Exam out of total marks. You have to calculate the percentage and print it with the grade that the student has got.




print("Exam Grade Calculator")
subj= input ("Name of the exam:")
if subj == "cs" :
maxscore = int(input("Max possible score:"))
urscore= int(input("what is your score:"))
percentage = int((urscore/maxscore)*100)
print(percentage)
if percentage >= 90:
print("you got",percentage,"% which is a A+")
    elif percentage >= 80:
       print("you got",percentage,"% which is a A-")
    elif percentage >= 70:
       print("you got",percentage,"% which is a B")
     elif percentage >= 60:
       print("you got",percentage,"% which is a C")
    elif percentage >= 50:
       print("you got",percentage,"% which is a D")
    elif percentage >= 40:
       print("you got",percentage,"%which is a E")
    else:
       print("you got",percentage," % which is a F")
else:
       print("we dont deal with the subject")

No comments:

Post a Comment

  2D Dictionaries Remember that dictionaries are very similar to lists, except that they store data as key:value pairs. The value is what it...