Conversão de Tupla em Lista em Python
Para converter uma tupla em uma lista, é necessário
aplicar a função list:
pythontpl = ('a', 'b', 'c')
res = list(tpl)
print(res) # exibirá ['a', 'b', 'c']
Задание 1
Dada a tupla:
pythontpl = ('2', '6', '12')
Converta-a em uma lista.
Задание 2
Dadas as tuplas:
pythontpl1 = ('1', '2', '3')
tpl2 = ('4', '5')
Crie a seguinte lista a partir delas:
python['1', '2', '3', '4', '5']
Задание 3
Dada a tupla:
pythontpl = (1, 2, 3, 4, 5)
Inverta-a:
python(5, 4, 3, 2, 1)