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 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
Certainly Heres a Python program with the histon function ... View full answer
Get step-by-step solutions from verified subject matter experts
