Question: How do I define a function that takes a list of strings as it's parameter and returns a colours dictionary from the parameter string? -->

How do I define a function that takes a list of strings as it's parameter and returns a colours dictionary from the parameter string?

--> def create_colours_dictionary(lines)

lines = ['1:brown' , '2:bisque' , '3;white' , '4:purple' , '5:tan']

output:

1 brown

2 bisque

3 white

4 purple

5 tan

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!