math = 0
sciense = 0
geography = 0
i = 0
while i < 5:
math += float(input("Enter Math mark for student " + str(i + 1)+": "))
sciense += float(input("Enter Science mark for student " + str(i + 1)+": "))
geography += float(input("Enter Geugraphy mark for student " + str(i + 1)+": "))
i = i + 1
print()
print("Total Math mark: " + str(math) + ", average: " + str(math/i))
print("Total Science mark: " + str(sciense) + ", average: " + str(sciense/i))
print("Total Geography mark: " + str(geography) + ", average: " + str(geography/i))
Comments
Leave a comment