Długość krotki Pythona
Długość krotki
Aby określić, ile elementów ma krotka, użyj len()
metody:
Przykład
Wydrukuj liczbę elementów w krotce:
thistuple = ("apple", "banana", "cherry")
print(len(thistuple))
Aby określić, ile elementów ma krotka, użyj len()
metody:
Wydrukuj liczbę elementów w krotce:
thistuple = ("apple", "banana", "cherry")
print(len(thistuple))