Avatar ·

How to fix it? 'Ints Object is not Subscriptable

📁 python

Here is the task: to generate 20 random integers in the range from -5 to 4, to write them down in the cells of the array. Count how many positive, negative and zero values ​​among them. Bind the elements of an array and counted quantities to the screen. Here is the text of the error:

  a [i] =  int  (a [i]) typeerror:  'in' inteat '  object   is   not  subscriptable class = "">   import  radoma = []   for  i  in  in   range  ( 20 ):  a = radom.randint (- 5 ,  4 ) p = [] n = [] z = []   for  i  in   range  ( 20 ):  a [i] =  int  (a [i])   for  i  in   range  ( 0 ,  20 ,  1 ):   if  (a [i] & gt;  0 ):  P.Append (A [ class = ""> if  (a [i] & lt;  0 ):  n.ppend (a [i])   print  ( '' 'QUANTITY positive ',  len  (p))   print  (' 'quantity negative' ,  len  (n))   print  ( 'quantity zero' ,  len  (z)) r