About 50 results
Open links in new tab
  1. python - How do I count the occurrences of a list item? - Stack Overflow

    Apr 8, 2010 · 2224 Given a single item, how do I count occurrences of it in a list, in Python? A related but different problem is counting occurrences of each different element in a collection, getting a …

  2. python - Count the number of occurrences of a character in a string ...

    How do I count the number of occurrences of a character in a string? e.g. 'a' appears in 'Mary had a little lamb' 4 times.

  3. python - Is there a way to track the number of times a function is ...

    Feb 12, 2014 · Voilà! This works because a Python function "knows" itself (this is a necessary feature, so that functions can call themselves recursively if desired). If you wish to keep some information …

  4. python - How to count the frequency of the elements in an unordered ...

    119 Python 2.7+ introduces Dictionary Comprehension. Building the dictionary from the list will get you the count as well as get rid of duplicates.

  5. What is a good way to do countif in Python - Stack Overflow

    0 I know the question above is very well taken care of already, but if you are new in the python world and happen to be here because you searched for the simple keyword "Countif python" (and google …

  6. How to count function calls using decorators? - Stack Overflow

    Jul 7, 2017 · This inner function is being inserted as a "replacement" for whatever function is being decorated. So when your module foo.succ() function is looked up, the result is a reference to the …

  7. How do I measure elapsed time in Python? - Stack Overflow

    The python cProfile and pstats modules offer great support for measuring time elapsed in certain functions without having to add any code around the existing functions.

  8. How can I find the number of arguments of a Python function?

    May 11, 2009 · 264 How can I find the number of arguments of a Python function? I need to know how many normal arguments it has and how many named arguments. Example:

  9. Why does the count() function in python only allow '3 arguments' and ...

    Feb 26, 2024 · Why does the count () function in python only allow '3 arguments' and how to overcome Asked 1 year, 11 months ago Modified 1 year, 11 months ago Viewed 346 times

  10. How do I get the number of elements in a list (length of a list) in ...

    Nov 11, 2009 · You are obviously asking for the number of elements in the list. If a searcher comes here looking for the size of the object in memory, this is the actual question & answers they are looking …