Question: Write a function called ` data _ to _ dictionary ` that converts the data into a dictionary such that: 1 . There is a

Write a function called `data_to_dictionary` that converts the data into a dictionary such that:
1. There is a single key for each character in Hamilton.
2. The value corresponding to each key is a list of the characters to which that key links. The list should contain repeats if there are multiple links.
Here's an example of the desired behavior on a fake data set.
```python
data =[("a","b"),
("a","b"),
("a","c"),
("b","c"),
("b","a")]
data_to_dictionary(data)
# output
{"a" : ["b","b","c"],"b" : ["a","c"]}
```

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!