なぜこのエラーが発生するのですか?
a[k] = q % b
TypeError: 'int' object does not support item assignment
コード:
def algorithmone(n,b,a):
assert(b > 1)
q = n
k = 0
while q != 0:
a[k] = q % b
q = q / b
++k
return k
print (algorithmone(5,233,676))
print (algorithmone(11,233,676))
print (algorithmone(3,1001,94))
print (algorithmone(111,1201,121))