which command would you use to update the list?
we can update an element in a list by doing:
your_list[index] = "new value"
Well, you don't really use a "command" to update an element in a list, per se. You simply just set the element in the list equal (
=) to the desired value. For instance:
x = x + 1
This would set the first item in the
x list equal to itself plus
1. This can also be achieved using a shorthand:
x += 1
x = x + 3
n = [3, 5, 7]
so this still isnt working
that is because you return the second item in the list, the instructions state that you should return the whole list
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.