Hardware Reference
In-Depth Information
FIGURE.4-3 Experimenting with Python lists in the Python Shell
The length of a list will change as you add new items to it and remove items from
it. What happens if you try to access an item in the list that does not exist? Try
this at the Python Shell and see what happens:
b = []
print(b[26])
How do you think you could prevent this from happening in your programs?
(Note there is more than one right answer to this question. You could do some
research on the Internet to find out the different ways you can prevent this
problem in your programs.)
Search WWH ::




Custom Search