I tried to run this code, but it showed an error:
def shoot(aliens):
s=[0]*1000
s[0]=0
s[1]=1
num=len(aliens)
b=[[0 for m in range(1000)] for n in range(1000)]
for j in xrange(2,num):
for i in xrange(0,j):
b[j][i]=s[i]+min(int(aliens[j]),f[j-i]) ##Error here
s[j]=max(b)
and the error:
Traceback (most recent call last):
File "module1.py", line 67, in <module>
print shoot(line)
File "module1.py", line 26, in shoot
b[j][i]=s[i]+min(int(aliens[j]),f[j-i])
TypeError: can only concatenate list (not "int") to list
please help!
Edit: added more code. s, aliens and f are other arrays. I tried to save the result to the 2 dimentional array, but it showed that error.
s,fandaliens?