Question: PYTHON: I need help. This shouldn't be too hard. I have a function (di) that takes in a list of integers and generates a dictionary

PYTHON:

I need help. This shouldn't be too hard. I have a function (di) that takes in a list of integers and generates a dictionary with frequency values for every number.

'''

li = [1,2,3,4,5,6,6,7]

>>>di(li)

{1:1, 2:1, 3:1, 4:1, 5:1, 6:2, 7:1}

'''

I need to make 2 new functions that implements this function inside. One of the function returns the mode value (with the number) and the other one generates a table of the dictionary (EX:)

'''

>>>fTable(li)

ITEM FREQUENCY

1 1

2 1

etc.

'''

BOTH basically rely on the dictionary returned by the first function. I'm not sure how to write these since i'm so new to dictionaries. Please help!

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 Databases Questions!