Data Structures

Python data structures include lists, dictionaries, tuples, and sets.

list = [1, 2, 3]
dictionary = {1: "one", 2: "two", 3: "three"}
tuple = (1, 2, 3)
set = {1, 2, 3}

print("list:", list)
print("dictionary:", dictionary)
print("tuple:", tuple)
print("set:", set)

Output:

list: [1, 2, 3]
dictionary: {1: 'one', 2: 'two', 3: 'three'}
tuple: (1, 2, 3)
set: {1, 2, 3}

results matching ""

    No results matching ""