Printing out a list item by item in a function


#1



Replace this line with your code.
Am I doing this wrong? It makes sense to me but outputs that I didnt call print_list(n), or there is something wrong because 3 wasn't printed.

I've tried multiple ways to call print_list, and the hint makes it sound like their should be minimal changes. Super frustrating


n = [3, 5, 7]

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


#2

Am I doing this wrong? It makes sense to me but outputs that I didnt call print_list(n), or there is something wrong because 3 wasn't printed.

I've tried multiple ways to call print_list, and the hint makes it sound like their should be minimal changes. Super frustrating

n = [3, 5, 7]

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

#3

if you tried multiply ways to call print_list, can you show us what you tried?


#7

5 posts were split to a new topic: [solved]print out a list item by item in a function


#8

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