Question about 11/18


#1

I solved the exercise I just have a doubt
why do we return lst and not list_extender
here’s the code :
n = [3, 5, 7]

Add your function here

def list_extender(lst):
lst.append(9)
return lst

print list_extender(n)


#2

lst is the list we modify, we want to return the modified list. list_extender is just the function, why would the function return itself?


#3

A post was split to a new topic: Question about print


#4

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