+ 2

Python lists

Can we store values of different data types in one list?

28th Jan 2018, 2:50 AM
Haider Ali
Haider Ali - avatar
2 Answers
+ 6
Yeah: list = ["words", 3] print(list[0]) print(list[1])
28th Jan 2018, 3:00 AM
Ole113
Ole113 - avatar
+ 2
Yes see the example below: x = ["this_is_word_1", 3] print(x(0)) print(x(1))
22nd Aug 2020, 1:01 PM
Spectreops_Unknown
Spectreops_Unknown - avatar