Hi guys, I have a list of random numbers and I want to know how many times each number occurs on the list ; I want them ordered by the ones that occurred the most first.
This is my program :
is there a way I can use two functions at the same time in this loop.
thanks
This is my program :
lex=(1,2,3,4,5,6,1,2,3,3,3) x=0 for i in range(7): print(x," appeared ", lex.count(i)) x+=1and this is what I get :
Output:0 is 0
1 is 2
2 is 2
3 is 4
4 is 1
5 is 1
6 is 1
what I need now is to order them from the ones that happened the most in the list: In this case 3 should be at the top because it happened four times ...is there a way I can use two functions at the same time in this loop.
thanks