Konvertering af tuple til liste i Python

For at lave en liste fra en tuple, skal du anvende funktionen list:

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

print(res) # vil udskrive ['a', 'b', 'c']
Задание 1

Givet en tuple:

pythontpl = ('2', '6', '12')

Lav en liste ud af den.

Задание 2

Givet tupler:

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

Lav følgende liste ud af dem:

python['1', '2', '3', '4', '5']
Задание 3

Givet en tuple:

pythontpl = (1, 2, 3, 4, 5)

Vend den om:

python(5, 4, 3, 2, 1)