Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

Python: Count occurrences in list/tuple

📅 2009-Sep-28 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ lists, python, tuples ⬩ 📚 Archive

inList = [1, 2, 3, 3, 4, 5]
inList.count(3) # Count occurrences of 3 in list

© 2023 Ashwin Nanjappa • All writing under CC BY-SA license • 🐘 Mastodon📧 Email