14/18 Passing a range into a function


#1

Hey guys, whats wrong with my code? I tried everything and i cant get the answer...
Checked the forum, my code seems to be ok.

def my_function(x):
for i in range(0, len(x)):
x[i] = x[i] * 2
return x
print my_function(range(3))


#2

Hi @rybecki.
Make sure you indented your code well.
when a new block starts ,you need to space it out by 4 spacebars.


#3

It is indented well. Still don`t know what to do... :frowning:


#4

Format your code.

When I tested your code after fixing the indentation ,It lets me pass.


#5

Hey guys, you were right. Indentation was wrong. Thanks for help!


#6

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