I have a list which has types of cars,
a = ['Car_1','Car_1','Car_1','Car_2','Car_3','Car_3']
I should be able to create an output of 2 lists from the above list,
result_count = [1,0,0,1,1,0] #Whenever new car type is present in list, make it 1
result_count = [1,2,3,1,1,2] #Count each car type
How can I easily achieve this without using for loops? Thanks.