Classwork 13 - UMBC-CMSC104/General GitHub Wiki

We're going to practice loops and dictionaries in this classwork. Name this file game_scores.py.

Given the following dictionary array:

game_scores = [{'game': 'EVE Online', 'score': 8.5}, {'game': 'Gears of War', 'score': 9.8}, {'game': 'Space Quest 6', 'score': 10}, {'game': 'Terranigma', 'score': 8.2}]

Write a program that

  • Prints out each element using a loop. Use len(game_scores) to determine the size of the game_scores array for looping purposes.
  • Calculates an average of scores based on the size of the array. Use len(game_scores) in your calculation.

To run:

python game_scores.py

To submit:

submit cs104_wilson cw13 game_scores.py