Checkpoint 10.2.1.
- 6
- 6 is in the wrong list. alist[1] refers to the second item in alist, namely [888,999].
- 8
- 8 is in the wrong list. alist[1] refers to the second item in alist, namely [888,999].
- 888
- Yes, alist[0][1][0] is True and alist[1] is the second list, the first item is 888.
- 999
- alist[0][1][0] is True. Take another look at the if statement.
What is printed by the following statements?
alist = [ [4, [True, False], 6, 8], [888, 999] ]
if alist[0][1][0]:
print(alist[1][0])
else:
print(alist[1][1])