148k views
2 votes
A sequence of data values separated by commas can be made into a list by enclosing the sequence in what type of symbols?

1 Answer

6 votes

Answer:

square brackets [ ]

Step-by-step explanation:

In python programming language a list is a data structure type that contains data values which can be of different data types separated by commas and enclosed in a pair of square brackets. in the example below, I have created a list and initialized the values

MyList = [ 2,3,4,5,"David", 2.5, 5.8].

This list contains three different data types integers, float and a string

This code below will produce the output that is attached as an image

MyList = [2,3,4,5,"David"]

print(MyList[0])

print(MyList[1])

print(MyList[2])

print(MyList[3])

print(MyList[4])

Observe that list follow the zero-based indexing

A sequence of data values separated by commas can be made into a list by enclosing-example-1