I was doing a small program that count the number of times that a character appears in a list and I have a question, ¿Is possible to do it by consecutive numbers?. I have this code now:
def function(list):
final_list = []
for element in set(list):
final_list.append([element, list.count(element)])
return final_list