Answer to Question #319475 in Python for Psy

Question #319475

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

1
Expert's answer
2022-03-28T11:01:08-0400
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?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS