Question: Create a function that takes a tuple and returns a dictionary that is a histogram that counts how many times each number gets into

Create a function that takes a tuple and returns a dictionary that is a histogram that counts how many times

Create a function that takes a tuple and returns a dictionary that is a histogram that counts how many times each number gets into the tuple: The main program must take the dictionary, transform the items in a list, use sort() to order the list(in ascending order) and then display it. def histo_n (x) : ''' (tuple) ->dict Returns a dictionary Precondition: thee tuple contains integers >> t = (1, 2, -3, 3, 4, -3,3,3) >>> histo_n (t) {1: 1, 2: 1, 3: 3, 4: 1, -3: 2} Activ Go to

Step by Step Solution

3.39 Rating (155 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Certainly Heres a Python program with the histon function ... 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!