KnowledgeBoat Logo
|

Robotics & Artificial Intelligence

Which of the following is the correct representation to define a list in Python?

  1. Elements are written using curly braces { }
  2. Elements are written using parentheses ( )
  3. Elements are written using square brackets [ ]
  4. Elements are written using angle brackets < >

Python Funda

1 Like

Answer

Elements are written using square brackets [ ]

Reason — In Python, a list is defined as an ordered sequence of one or more data items separated by commas and enclosed within square brackets [ ].

Answered By

1 Like


Related Questions