Time complexity of list.count in Python
Recently, I've came across this article on Microsoft documentation: http://msdn.microsoft.com/en-us/library/27b47ht3%28v=vs.110%29.aspx It's about the implementation of list.count in C#, from what I can see, it uses an internal int to track the number of items, so retrieving count is O(1) operation. count can definitely reduce some lines and can be pretty helpful some times, but I always try to avoid it in algorithms, because I thought it iterated over the whole list, so using it in the loop makes the time complexity of the algorithm O(N^2) which is not optimal. Unfortunately I couldn't find anything similar to this for python, I can't understand C well, so I couldn't analyze the implementation from the source code, could anyone explain how is it implemented? What is the time complexity?