Counting Item Occurrences in Python

https://youtu.be/7dFpFirCB54?si=dglWwRabucQ7zjhh from collections import Counter name_list = ['Tom','Peter','Mike','John','Tom'] name_counter = Counter(name_list).get("Tom") print(f'Tom appears in the list {name_counter} times.') counter = 0 for name in name_list: if name == 'Tom': counter…