Robotics & Artificial Intelligence
Which of the following is the correct representation to define a list in Python?
- Elements are written using curly braces { }
- Elements are written using parentheses ( )
- Elements are written using square brackets [ ]
- Elements are written using angle brackets < >
Python Funda
3 Likes
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
2 Likes
Related Questions
Given:
m = 24What is the data type of the given Python variable?
- String
- Integer
- Float
- Double
Which data type in Python is used to store a sequence of characters?
- Char
- String
- Text
- Word
Which of the following data type would be used for a variable to store the value 3.14 in Python?
- int
- decimal
- double
- float
Which of the following data types would be used in Python to store values in terms of key and value?
- list
- tuple
- dictionary
- String