Adding an Element to a Set in Python

Although it is not possible to add an element by its index, it is still possible to increase the number of elements in a set. This is done using the add method. Its parameter specifies the element to be added.

Let us have a set:

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

Let's add a new element to it:

pythonst.add('e')
print(st) # {'a', 'd', 'e', 'c', 'b'}

If you try to add the same element again, the set will remain the same. Since it cannot contain duplicates:

pythonst.add('a')
print(st) # {'d', 'c', 'b', 'a'}
Задание 1

Given a set:

pythonst = {1, 2, 3}

Add one more element to this set.

Задание 2

Given variables:

pythontxt1 = 'xyz'
txt2 = 'xzy'
txt3 = 'xyz'

Add them sequentially to the set from the previous task. Output the resulting set to the console.