Ask your own question, for FREE!
Computer Science 20 Online
OpenStudy (anonymous):

Which is this data type in Python : a[ [1, 2] , "this text" ] in the given data please tell me which data type [1 , 2] is ?

OpenStudy (anonymous):

am not am expert i think its a list, thats the notation of it if i remember correctly

OpenStudy (anonymous):

I'd say it's a 2D array. e.g. To access that data you'd write somthing like this: a[1][1] = 1 a[1][2] = 2 a[2] = "this text"

OpenStudy (anonymous):

the whole structure its a 2D array, but he asked about [1,2] i think thats a list, in haskell thats the notation, and codes that i have saw in python am almost sure are list too

OpenStudy (anonymous):

I am asking about the data type.

OpenStudy (anonymous):

for eg. string or float or integer

OpenStudy (rsmith6559):

[ 1, 2 ] is a list of integers. It happens to be inside a list of list of integers and string, a[].

OpenStudy (jhonny111s):

The elements of a list don't have to be the same type. The following list contains a string, a float, an integer, and another list: ["hello", 2.0, 5, [10, 20]]

OpenStudy (jhonny111s):

is a list of integers

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!