Q1. Find the frequency of the given numbers 1 3 1 2 4 5.
Output:
1 2
2 1
3 1
4 1
5 1
def freq_num(list1): for i in set(list1): print(i, list1.count(i)) freq_num([1, 3, 1, 2, 4, 5]) 1 2 2 1 3 1 4 1 5 1
Need a fast expert's response?
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Comments
Leave a comment