I have an array of number which I changed to string
a="1423"
astr=str(a)
aspl=list(astr)
I should have ['1', '4', '2', '3']. I wanted to count how many 1~9 there are in the array so that 1 = 1 time(s), 2 = 1 time(s) ... 5 = 0 time(s), 6 = 0 time(s)...
My solution to this was
r=0
for r > 11:
b = aspl.count(r)
but since it is a string, this method does not work. I tried using
b = aspl.count('r')
then as you might have guessed, it's only looking for r. So how would you go about this?
Thanks in advance.