I have a code that displays the number of identical names in the list, but I also need these names to go to the new list and the output would be an array with duplicate elements. Help me please. Example: at the input ['Alex', 'Ighor', 'Alex', 'Djin'] at the exit ['Alex', 'Alex'] We need a function without using count.
list_of_student = ['Alex', 'Ighor', 'Alex', 'Djin'] def count_of_student(student): return list_of_student.count(student)