Question: Create an empty dictionary called func_dict For each item in iterable, create a key/value pair inside func_dict. The key will be the item from

Create an empty dictionary called func_dict For each item in iterable, create

 

Create an empty dictionary called func_dict For each item in iterable, create a key/value pair inside func_dict. The key will be the item from iterable, and the value will be whatever's returned when you call your function with the item as an argument. Use one of the approaches you've used in class For example: My iterable is [1, 2] My function is called plus_one(). It adds one to whatever argument it gets. My dictionary should look like this: (1:2, 2:3)

Step by Step Solution

3.46 Rating (156 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

You can create the funcdict dictionary by iterating through the given iterable ... View full answer

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!