13/18 double_list([0, 1]) returned <function double_list at 0x7fab7fc98938> instead of [0, 2]


#1



Hello, please, can you explain what am I doing wrong?

https://www.codecademy.com/courses/python-beginner-nzzVa/3/2?curriculum_id=4f89dab3d788890003000096


It writes here: Oops, try again. double_list([0, 1]) returned function double_list at 0x7fab7fc98938 instead of [0, 2]


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

Great thanks in advance!


#2

@anny_nny ,

The function is named double_list. Given that fact, what object does this statement return? ...

return double_list

Consider what it should return, instead.


#3

Yeah, I should've used list, not function, and didn't notice it. Thank you :slight_smile:


#4

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