.append() MemoryError


#1

When I run the below code I get a MemoryError on line 5, I've tried researching .append() as this is the first time I've used it but I don't really understand what i am doing wrong. Also I'm running it on a desktop PC with plenty of ram spare. Thanks, Dan

start_list = [5, 3, 1, 2, 4]
square_list = []

for number in start_list: # Your code here!
    start_list.append(2**number)

square_list.sort()
print square_list


#2

append the square_list not the start_list.


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.