Computer Science, asked by garvithagarwal0505, 12 days ago

Which line will cause an error? 1. num=[5,4,3,[2],1] 2. print(num[0]) 3. print(num[3][0])​

Answers

Answered by shrihankp
0

Answer:

No lines will cause an error.

Explanation:

1. It defines a list named num.

2. It accesses the first element of the list num and prints it (output is 5).

3. It accesses the first element inside the third element, which itself is an inner list, of the outer list num (output is 2).

There's no sign of an error.

Similar questions