Question: . Define a function named getCircles with a single parameter: The parameter, called shapeList in this description, is a list of strings of the The

. Define a function named getCircles with a single parameter: The parameter, called shapeList in this description, is a list of strings of the The function should return a list of dictionaries. The input list is a list of string of the types created in Milestone 1. The function looks through that list and identifies each string that starts with the word circle. Each circle entry is converted into a dictionary with the following key/value pairs: 'color': a list containing the integers red, green, and blue color channels 'x': integer for center x coordinate 'y': integer for center y coordinate 'radius': integer for radius 'depth': integer for depth All of the dictionaries are added into a single list in the order they appeared in the input list and returned. Test Cases: getCircles(['circle 25500001020']) should evaluate to [{'color': [255,0,0],'x': 0,'y': 0, 'radius': 10, 'depth': 20}] getCircles(['circle 25500001020', 'circle 02550-10-401020']) should evaluate to [{'color': [255,0,0],'x': 0,'y': 0, 'radius': 10, 'depth': 20},{'color': [0,255,0],'x': -10,'y': -40, 'radius': 10, 'depth': 20}] getCircles(['circle 25500001020', 'circle 02550-10-401020', 'rectangle 255000010201', 'rectangle 02550-10-4010202']) should evaluate to [{'color': [255,0,0],'x': 0,'y': 0, 'radius': 10, 'depth': 20},{'color': [0,255,0],'x': -10,'y': -40, 'radius': 10, 'depth': 20}]

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!