What will be the output of the following code? | List Que. 15

15. What will be the output of the following code?

L1=["apple","hello",1,2,3,"hello world","banana",["Car","Bike",1,2,3,4]] ;
print(L1[-2])
  1. 3
  2. Hello
  3. Banana
  4. 1

Answer: C) Banana

Explanation:

The -2 index denotes the second last element of the list.

List mcqs - que 15

Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.