More with for issue


#1

I know its probably simple enough but I'm drawing a blank on how to .append each number to square_list:

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

Your code here!

for number in start_list:
2 ** number
square_list.sort()

print square_list


#2

my_list = []
my_list.append(4)
print my_list  # [4]

#3

I solved problem. Thank you


#4

Hi, @kevgro81. How did you solve this one? Can you share here, please? I think I didn't get this syntax at all =/

Thanks in advance


#5

No problem.

when you (.append) , make sure you put the name of the list or variable your appending before the
.append. Or is it a different aspect of the code you are having trouble with?


#6

Thanks for the response! Thing is i'm more noob than you may think! This is what I got. Not really sure what goes inside the ()'s for the append command:

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

# Your code here!
for number in start_list:
** 2 ** number**

square_list.append(???)
square_list.sort()
print square_list


#7

Ha i got it! It's all part of the loop. Thanks for the response tho!

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

Your code here!

for number in start_list:
square_list.append(number ** 2)
square_list.sort()
print square_list


#8

Whats up bro. Pardon me for not responding sooner but I'm really glad you figured it out. Also, I'm no where near a vet at this either. The fact that I had a hand in helping you out means the world to me so thank you as well.