count of each element of a list using python

Опубликовано: 24 Апрель 2026
на канале: Edu_Tech
145
5

This is the actual logic:
=================================================
1)Initializes an empty dictionary dict.Iterates through the list.
If the current element is already a key in the dictionary, increment its value by 1.
2)If it's not in the dictionary, add it as a key with a value of 1.
Iterates through the dictionary and prints each key-value pair.