Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def display_average(students):
- for student in students:
- score = 0
- count = 0
- for i in range(1, len(students[student])):
- score = score + students[student][i]
- count += 1
- print(f'Average of {students[student][0]} is {score/count}')
- def main():
- students = { 'CCU101': ['Anna', 88.5, 98.5, 78, 85, 92.5],
- 'CCU102': ['Alex', 98,91,90,92,88],
- 'CCU103': ['Bob', 99.5, 98.5, 96, 96, 89.5],
- }
- display_average(students)
- if __name__=='__main__':
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement