This Python code takes marks from various subjects as input from the user, calculates the average, and uses if/else statements to determine the grade based on the average. It prints the calculated grade and a thank you message for each possible average range: A+ for averages 90-100, A for 80-90, B for 70-80, C+ for 55-60.
This Python code takes marks from various subjects as input from the user, calculates the average, and uses if/else statements to determine the grade based on the average. It prints the calculated grade and a thank you message for each possible average range: A+ for averages 90-100, A for 80-90, B for 70-80, C+ for 55-60.
This Python code takes marks from various subjects as input from the user, calculates the average, and uses if/else statements to determine the grade based on the average. It prints the calculated grade and a thank you message for each possible average range: A+ for averages 90-100, A for 80-90, B for 70-80, C+ for 55-60.
1 # Online Python conpiler (interpreter ) to run Python online.
2 # Nrite Python 3 code in this online editor and run it. 3 print("hello! :)") 4 eng-int(input("please enter your english marks(out of 100): ")) 5 math-int (input("please enter your math marks(out of 100): ")) 6 sci=int(input("please enter your science marks(out of 100): ")) 7 soc-int(input("please enter your social marks(out of 100): ")) 8 hindi-int (input("please enter your hindi marks(out of 100): ")) 9 san-int(input("please enter your sanskr it marks(out of 100): ")) 10 ict-int(input("please enter your ict marks (out of 100): ")) 11 avg-(eng+san+hindi+soc+sci+ath+ict)//n 12 if(avg =90 and avg<=100): 13 print("congratulations tyour grade is A+") 14 print("Ihank you") 15- if(avg=80 and avg<90): 16 print("congratulations lyour grade is A") 17 print("Thank you") 18- if(avg=70 and avg<80): 19 print("your grade is B") 20 print("Thank you") 21- if(avg»-60 and avg</0): 22 print("your grade is B") 23 print("Thank you") 24 if(avg=55 and avg<60): 25 print("your grade is C+ ")