I've seen someone else post something similar to my code so I'm fairly certain it's correct however I'm getting an error with it that and I can't understand why.
start_list = [5, 3, 1, 2, 4] square_list =  # for loop to append squared number to square_list for number in start_list: square_list.append(number ** 2) # sorts square_list, after the for loop has ran square_list = square_list.sort() print square_list
Oops, try again. Your code caused the following error: object of type 'NoneType' has no len()
Can someone shed some light please?
Trying to debug it I've added
print type(start_list) print len(start_list)
above the loop and I receive
<type 'list'> and
5 in the console.