nerdexam
Juniper

JN0-224 · Question #151

JN0-224 Question #151: Real Exam Question with Answer & Explanation

The correct answer is C. L = [0, 1, 2, 3, 4, 5]. In Python, to create a list, you use square brackets []. The correct syntax to create a list containing the numbers 0 through 5 is: L = [0, 1, 2, 3, 4, 5] This statement creates a list object that stores the specified integers.

Question

You want to make a list in Python to store data. Which statement is the correct way to accomplish this task?

Options

  • AL = "0, 1, 2, 3, 4, 5"
  • BL = {0, 1, 2, 3, 4, 5}
  • CL = [0, 1, 2, 3, 4, 5]
  • DL = (0, 1, 2, 3, 4, 5)

Explanation

In Python, to create a list, you use square brackets []. The correct syntax to create a list containing the numbers 0 through 5 is: L = [0, 1, 2, 3, 4, 5] This statement creates a list object that stores the specified integers.

Community Discussion

No community discussion yet for this question.

Full JN0-224 Practice