For one and all


Can anyone tell me why the below code would not be correct?

my_list = [1,9,3,8,5,7]
times_two = []

for number in my_list:
times_two.append(number * 2)
print times_two

I get the error: It looks like your loop did not print 2!

But AFAIK it does print 2. Am I missing something?



you need to print out 2*number for every number in the list. You did this by creating a list that contains all the doubled numbers and printing it out, but for the lesson you need to print out every number by itself.

You can do this without creating a new list, or by printing out every number in the times_two list by itself.