Presence of element in tuple in Python

You can find out whether a given element is in the list using the in operator:

pythontpl = ('a', 'b' 'c')
res = 'a' in tpl

print(res) # True

To check for the absence of an element, you should use the not in operators:

pythontpl = ('a', 'b' 'c')
res = 'a' not in tpl

print(res) # False
Задание 1

A tuple is given:

pythontpl = (2, 4, 6, 10)

Check if it contains the number 8.

Задание 2

A tuple is given:

pythontpl = ('abc', 'def')

Check if it contains the string 'd'.

Задание 3

The following code is given:

pythontpl = ('1', '2', '3')
res = 1 not in tpl

print(res)

Tell me what will be output to the console.

Задание 4

The following code is given:

pythontpl1 = ('ac', '3', 4, 'bd', 5)
tpl2 = (1, 2, 3)

res1 = 4 in tpl1
res2 = 2 not in tpl2
print(res1)
print(res2)

Tell me what will be output to the console.