0
Lists
Which line of code will cause an error? num = [5, 4, 3, [2], 1] print(num[0]) print(num[3][0]) print(num[5]) Tell the answer.
3 Respuestas
0
Indexerror in last line
+ 5
The last line i.e print(num[5]) will cause an error because that item doesn't exists in the list.
So, I think it will cause an index error.
But, you should Check it yourself.
Why we will give you the error line or output.
We're not interpreter or complier or IDE.
These things you can check it yourself.
A meaningful question you would have asked should look something like this:
Why this is causing an error???
.............
Or
Why the output is .....??
.....
So, try to ask meaningful and relevant questions.
0
Run and see simple 😁