For Loop Error


Hello Team,

I am doing the below exercise

and my code is like this

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

for x in start_list :
print square_list

But I am getting error like below.Please help me

File "python", line 5
IndentationError: expected an indented block


to place something inside a loop, it needs indention. Its common to use 4 spaces

The error is pretty self explaining?


Yes..My bad....thanks corrected it


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