Rémi Lapeyre <remi.lape...@henki.fr> added the comment: Hi cmaliwal! You are mutating the list while iterating over it which can lead to all sorts of issues, to keep the unique elements of a list you can do
>>> a = [1, 1, 1, 1] >>> list(set(a)) [1] If you think you found a bug in Python please check in the python-help mailing list or StackOverflow. ---------- nosy: +remi.lapeyre title: list.count() isn't working as expected for the series of same numbers in a list -> list.Count() isn't working as expected for the series of same numbers in a list _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue40809> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com