Alright, brand new to coding and the lesson is getting away from me.
Define a function called print_list that has one argument called x.
Inside that function, print out each element one by one. Use the existing code as a scaffold.
Then call your function with the argument n.
So they haven't introduced range or what it does or why it works in this lesson. They just say don't worry about it you'll learn about it later. But I don't understand what it is specifically doing in this code and therefore am very lost.
n = [3, 5, 7] for i in range(0, len(n)): print n[i]
So I get that they want us to use the scaffolding provided, but I don't understand what the range function does in this context? I looked up what it does and it makes sense but not in the context of what the lesson is trying to make me achieve if that makes any sense?
Like I would assume that I could just do something like:
def print_list(x): for num in x: print num
Which I think would work? But it won't accept it as correct because it doesn't match the scaffolding of the example code provided and I don't know if it's just because it's not ~their way~ or if what I've written isn't doing what they're asking.
Help please and thank you.