ARTICLE AD BOX
Error I am getting:
IndexError: list index out of rangeMy code:
number = [1, 2, 3] print(number[5])What I expected:
I expected it to print the element at index 5.
What actually happened:
Python showed IndexError: list index out of range.
What I tried:
I checked my list.
I tried printing other indexes.
I still couldn't understand why this error happens.
Question:
Why is this error happening, and how can I fix it?
