On 5/16/2012 1:17 PM Greg Christian said...
def factors(n): L = [] for i in range(1, int(n ** 0.5) + 1): if (n % i == 0): L.append(i) return L
... now you've completed defining the function factors...
def main(): factors = 0
... and here you create an integer of the same name...
counter = 0 L = [] while len(L) < 50: counter += 1 L.append(counter) Tn = sum(L) x = factors(Tn)
... and here you attempt to call the interger factors passing it the argument Tn
#print x print(sum(L))
Also, in the future please post the complete traceback -- it relly helps. Emile _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor