Question: Python Principles A. make a dictionary goals to store the mapping of soccer players to number of goals they scored. Populate the dictionary with following

Python Principles

A. make a dictionary goals to store the mapping of soccer players to number of goals they scored. Populate the dictionary with following data: Bican 805, Romario 772, Pele 767 (2 marks)

B. Write code to iterate over the above dictionary and print out names of all players who have scored less than 800 goals. (5 marks)

C. What is wrong with the following piece of code? try: # some file handling and other code goes here # that can potentially cause exceptions except Exception: print('Some error occurred') except IOError: print('An error occurred with file I/o')

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!