AlgoCademy
Lesson
Code

Updating list elements in {lang}


Unlike strings, the entries of lists are mutable and can be changed freely, using indices and the bracket notation:

myList = ["Hello world!", 32, false]

myList[0] = 15
myList[1] = "second element";

print(myList) # Output: [15, "second element", false]

Assignment
Follow the Coding Tutorial and let's play with some arrays.


Hint
Look at the examples above if you get stuck.