What types of list can be use in Python

1 Answer

0 votes
empty_list = []
print(empty_list)

list_of_integers = [1, 2, 3, 4, 900]
print(list_of_integers)

list_of_mixed_data_types = [31, "python", 3.14]
print(list_of_mixed_data_types)

list_of_strings = ["python", "php", "java", "c", "c++", "c#"]
print(list_of_strings)

nested_list = [["html", "css", 12], ["python", "java", "c#", 11], ["c", "c++", 13]]
print(nested_list)

deeply_nested_complex_list = ["E.T", ["grandparents", ["parents", ["tom", "alma", 17]]]]
print(deeply_nested_complex_list)


'''
run:

[]
[1, 2, 3, 4, 900]
[31, 'python', 3.14]
['python', 'php', 'java', 'c', 'c++', 'c#']
[['html', 'css', 12], ['python', 'java', 'c#', 11], ['c', 'c++', 13]]
['E.T', ['grandparents', ['parents', ['tom', 'alma', 17]]]]

'''

 



answered Nov 30, 2017 by avibootz
edited Dec 1, 2017 by avibootz
...