12.List Item by Item


unable to understand logic and function can any help me in this matter

Oops, try again. The body of your function should not contain any references to 'n'

i have change n to x also
and call the function from outside the loop also.

n = [3, 5, 7]

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


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


is this correct ?


you don't have to return x, but yes, its right :slight_smile:

Do you have any questions about it?


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