Which list am I appending to and returning?


#1

Question

Which list am I appending to and returning?

Answer

nside of our new function called list_extender we work with the list provided as an argument: lst. This is the list we append to and then, on the next line, return in its entirety.

def function_name(parameter_list):
  # Append to the list using list_name.append(value)
  # Return the entire list, not just the new value

FAQ: Learn Python - Lists and Functions - List manipulation in functions
#2

A post was split to a new topic: Am I missing something?