QuestionQ38

Python/PyEZ

You want to create a Python list to hold data.

Which statement correctly accomplishes this task?

  • A L = "0, 1, 2, 3, 4, 5"
  • B L = {0, 1, 2, 3, 4, 5}
  • C L = [0, 1, 2, 3, 4, 5]
  • D L = (0, 1, 2, 3, 4, 5)
Explanation

Python list literals use square brackets ([]) with comma-separated elements. Strings use quotation marks, sets use curly braces, and tuples use parentheses.

Community Discussion

No comments yet. Be the first to start the discussion!