What is the error in this code?function returns only one element of the array


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

def square(my_list):
  for i in my_list:
	return square_list

print square(start_list)


Check the indentation on your return line.


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