I am trying to get a loop which will tell me the number of 0 in a array of 50 random intergers from 0 to 2 (not including 2). And which will then calculate random integers again for the number of zeroes obtained.
I tried doing it but I am getting stuck at the primary stages and it is getting frustrating so any help would be much appreciated.
from numpy.random import randint
n = 50
R = randint(0,2,n)
for i in R:
True = 0
print array(True)
But it doesn't return an array and I don't know how to count the number of 0's as I can't use the len function as I normally would.
I tried using the while loop as well but ran into similar problems