Avatar ·

Create a list of lines with numbers through a gap

📁 строка, python, работа

there is a line:

'45 30 55 20 80 20 '.

It is necessary to create an array from the numbers included in this line:

[45, 30, 55, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20 80, 20].

I thought for a long time and came only to such a code, just does not work:

   for  i  in   range  ( len  (q)):   if  q [i]! = ( '">' '' '' ' '):  e+= q [i]   else :  w.ppend ( int  (e))  e = ' '   print  (w)     

the problem is that he does not see the last 20, please help