[Solved] How can I find and calculate the repeats? [closed]


Here is how you use Counter():

from collections import Counter
count = Counter(a + b + c + d + e) # Add all lists together, and then count them

NOTE: You have to convert the inputs into lists first. Here is how you can do that (based on your input – you can change the ", " into whatever you want):

print('Each class has five students.')
a=input('Enter the first class students. ').split(", ")
b=input('Enter the second class students. ').split(", ")
c=input('Enter the third class students. ').split(", ")
d=input('Enter the fourth class students. ').split(", ")
e=input('Enter the fith class students. ').split(", ")

solved How can I find and calculate the repeats? [closed]