How to find number of instances of an item in a python list -


i want part of script this.

if list[1] in list.pop n times:       return true 

simply use:

list.count(element) 

example:

>>> [1,2,3,4,2,1].count(1) 2 

Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -