Questions
- Answer: A script accesses the items in a list using the index number.
- Answer: They are numbered sequentially left to right starting with 0.
- Answer: A list can contain information like strings, int, and micropython.pin objects.
- Answer: Mutable means that a list can be changed after it is created.
Exercises
- Answer: Maria
- Answer: 4
- Answer: vlist[4] = '5'
- Answer: Use clist.append()
- Answer: It will return the index of the first instance of the word “snake” in the clist.
Project
Solution:
clist = [‘city1’, ‘city2’, ‘city3’, ‘city4’] while True: for city in clist: print(‘city = ’, city) sleep(1000) print()