Omskakeling van tupel na lys in Python

Om 'n tupel na 'n lys te omskep, moet jy die funksie list gebruik:

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

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

Gegee 'n tupel:

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

Skep 'n lys daaruit.

Задание 2

Gegee tupels:

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

Skep die volgende lys daaruit:

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

Gegee 'n tupel:

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

Draai dit om:

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