例如,我有这个代码,我收到的错误是:
TypeError: 'function' object is not iterable
我的代码:
def initialpopulation(numberofanimals, length):
pop = []
for i in xrange(numberofanimals):
pop.append(individual(length))
return pop
graded=[zip(OneAnimalSearch(radius,listsum(x),turnnum,AllotedDistance,foodcutoff,foodlist ),x) for x in initialpopulation]