0

python,lists

number = 3 things = ["string", 0, [1, 2, number], 4.56] print(things[1]) print(things[2]) print(things[2][2]) why "string" is used in this code?

17th Dec 2016, 6:50 PM
Nischay Soni
Nischay Soni - avatar
1 Respuesta
+ 2
The code is showing that a list isn't restricted to just one form of data. You can fill it with different data types and data structures such as integers,strings, floats,other lists, dictionaries and so forth.
17th Dec 2016, 8:08 PM
Don
Don - avatar