⊗pyPmStEl 107 of 208 menu

Set Element in Python

An important feature of the set is its disorder. This means that all elements are located arbitrarily and have no index. Also, each time the set is output to the console, the order of its elements will change.

Let us have the following set:

st = {'a', 'b', 'c', 'd'}

Let's try to access its element by index:

print(st[0]) # will display an error

The following code is given:

st = {'1', '2', '3'} print(st['2'])

Tell me what will be output to the console.

The following code is given:

st = {3, 4, 5} print(st[0])

Tell me what will be output to the console.

byenru