-1

We have a list containing lists like so:

My_list = [ [1,2,3],[4,5,6],[7,8,9],[1,2,3] ]

Is there an easy way to learn that the list item [1,2,3] appears twice in My_list? I am not interested in the individual numbers but i am interested in them as a list.

  • Possible duplicate of [How can I count the occurrences of a list item in Python?](http://stackoverflow.com/questions/2600191/how-can-i-count-the-occurrences-of-a-list-item-in-python) – beeftendon Nov 02 '16 at 21:32

1 Answers1

1

You may use list.count() in order to find the occurrence of item in the list as:

>>> My_list.count([1, 2, 3])
2
Moinuddin Quadri
  • 46,825
  • 13
  • 96
  • 126