Kortežo ilgis Python kalboje
Norint rasti kortežo ilgį, reikia
panaudoti funkciją len:
tpl = ('a', 'b', 'c')
print(len(tpl)) # išves 3
Duotas kortežas:
tpl = ('1', 'b', '3', 'd', '5')
Raskite jo ilgį.
Duotas kortežas:
tpl = (1, 2, 3)
Išveskite elementų kiekį šiame korteže.