1. Home
  2. Data Science
  3. Python
  4. How do you access the third element of a list named…

Added 4 May 2024

How do you access the third element of a list named my_list in Python?

  1. my_list[2] Correct answer
  2. my_list[3]
  3. my_list[1]
  4. my_list[0]

Correct answer

A. my_list[2]

17 views

MCQSEXAM

Explanation

 Python uses zero-based indexing, so the third element of a list can be accessed using my_list[2].

Doubts & discussion

Not sure why the answer is A? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Python MCQs

Practise all Python MCQs

Similar MCQs