2026fa_cse160/lecture20261110/lists/grades01.py

16 lines
401 B
Python

#!/usr/bin/python3
# grades01
# List element manipulation.
scores = [75, 95, 90, 87, 99, 100, 97]
# This is unnecessary and just here for debugging.
print(scores)
# We will sum the scores. Initialize sum value to zero then add each value to the sum.
sum = 0
for score in scores:
sum = sum + score
print("The sum of the seven scores is ",sum)
print("The average of the seven scores is ",sum/7)