Today we are going to share a Python program to calculate the average score. If you are a python beginner and want to start learning the python programming, then keep your close attention in this tutorial as I am going to share a Python program to calculate the average score.
1 2 3 4 5 6 7 8 9 | firstSubject = int(raw_input("Enter the score of first subject: ")) secondSubject = int(raw_input("Enter the score of second subject: ")) thirdSubject = int(raw_input("Enter the score of third subject: ")) #Calculate the average average = (firstSubject + secondSubject + thirdSubject) / 3 #Print out the test score print "The average score is: ", average |
Enter the score of first subject:10
Enter the score of second subject:15
Enter the score of third subject:20
The average score is: 15
Liked this program? Do Like & share with your friends.
If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.