⊗pyPmStPrm 125 of 208 menu

Practicing the material studied on working with sets in Python

Two sets are given:

st1 = {'x', '1', 'y', '2', 'z'} st2 = {1, 2, 3, 4, 5, 6}

Find out which one has the largest number of elements.

Two numbers are given:

num1 = 12345 num2 = 12321

Check that all digits of the second number are in the first number.

Three variables are given:

tst1 = 34 tst2 = [1, 2, 5] tst3 = (6, 7, 8)

Create a set from all their elements.

Given a set and two variables:

st = {'18', '24', '34', '47', '81', '63'} tst1 = '34' tst2 = ('81', '12', '46')

Check if the elements of each variable are included in the set.

Two numbers are given:

num1 = 12345 num2 = 45123

Check that both numbers have the same digits.

Two numbers are given:

num1 = 12345 num2 = 45678

Get a number consisting of the common digits of our numbers.

Three sets are given:

st1 = {'ab', 'b', 'ce', 'de', 'd'} st2 = {'ef', 'd', 'ab', 'bc'} st3 = {'a', 'g', 'b', 'c'}

Find the common elements for the first two sets. Then combine the resulting set with st3.

rubyswfrid