More with for


#1

hi guys can somebody explain why:

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

is NOT the same as:

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

much appreciated!


#2

Have you considered what ** is?
(Can you argue for why you would be able to switch places on the operands? If your question is based on some assumptions, then what are those assumptions?)


#3

Oh wow...cheers mate!


#4

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