17
Question Question 3(a)
Carefully read the given code fragments and figure out the errors that the code may produce.
t = ('a', 'b', 'c', 'd', 'e')
print(t[5])
Output
IndexError: tuple index out of range
Explanation
Tuple t has 5 elements starting from index 0 to 4. t[5] will throw an error since index 5 doesn't exist.