Write a program to count the occurrence of each element in a list | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Write a program to count the occurrence of each element in a list

16th Mar 2019, 6:27 PM
Rahul Singh
Rahul Singh - avatar
2 Answers
+ 2
Please rephrase as a question. You can probably use result = [{x:your_list.count(x)} for x in set(your_list)]
16th Mar 2019, 7:20 PM
ChrA
ChrA - avatar
+ 1
Please show us your attempt.
16th Mar 2019, 7:16 PM
Diego
Diego - avatar