12/18 I seem to have a problem with the indentation (solved)


#1

So here is my code:

n = [3, 5, 7]

def print_list(x):
  for i in range(0, len(x)):
    print x[i]

and I get the following error:

It looks like you either didn’t call print_list(n) or there is something wrong because 3 wasn’t printed.

I’m not sure what is the problem


UPDATE


this is my new code (slightly updated, and works just fine):

n = [3, 5, 7]

def print_list(x):
  for i in range(0, len(x)):
  	print x[i]

print_list(n)

my mistake was that I assumed that the function has to print out the entire list, without even calling it :sweat_smile:


#2

Expected indentation is usually four spaces per block level, but that might not be the problem. We do not see a call expression…

print_list(n)

#3

thanks! that was such a novice mistake :sweat_smile:


#4

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