I'm looking for a way to count the the number of times that an element appears in a list.
I found a way to do it but I am looking for a short an efficient way to do it.
Example:
Find the number of times the number 5
appears in the list l
.
l = [1, 1, 3, 4, 5, 5, 5, 5]
Expected Result would be 4
.