Kubadilisha Tuple kuwa Orodha katika Python
Ili kufanya tuple kuwa orodha, ni lazima
utumie kitendakazi list:
pythontpl = ('a', 'b', 'c')
res = list(tpl)
print(res) # itatolea ['a', 'b', 'c']
Задание 1
Imetolewa tuple:
pythontpl = ('2', '6', '12')
Fanyeni kuwa orodha.
Задание 2
Yametolewa matuple:
pythontpl1 = ('1', '2', '3')
tpl2 = ('4', '5')
Fanyeni yakuwe orodha ifuatayo:
python['1', '2', '3', '4', '5']
Задание 3
Imetolewa tuple:
pythontpl = (1, 2, 3, 4, 5)
Tupeleke upande wa pili:
python(5, 4, 3, 2, 1)