How indices in Python list are denoted?

9. How indices in python list are denoted?

L1= [99,12,3,33,"ram", "hello",122]
  1. L1[index 0] =99;
  2. L1[index (0)] =99;
  3. L1 [1] =12;
  4. L1(1) =12;

Answer: C) L1 [1] =12;

Explanation:

The index of the python list is denoted by: - List name [index]. In the example given above L1 is the list name and 1 is the index so the correct syntax would be L1[1] which will give you 12 as a result as at index 1 we have a 12 as its value.

Comments and Discussions!

Load comments ↻






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