say I have a list, x:
x=[1,2,3,4,1]
How do I search this list so that I can find the number of occurrences of a number and the list position it occurs in?
I know about using the method x.count(num)
, but this only shows number of occurrences not list position.
Thanks