Checkpoint 4.8.1.
- [4, 2, True, 8, 6, 5]
- Item assignment does not insert the new item into the list.
- [4, 2, True, 6, 5]
- Yes, the value True is placed in the list at index 2. It replaces 8.
- Error, it is illegal to assign
- Item assignment is allowed with lists. Lists are mutable.
What is printed by the following statements?
alist = [4, 2, 8, 6, 5]
alist[2] = True
print(alist)