我想知道如何将函数传递给python中的数组?

时间:2015-09-26 01:26:47

标签: python function loops

例如,我有这个代码,我收到的错误是:

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]

0 个答案:

没有答案