Python Tuple Length
Tuple Length
To determine how many items a tuple has, use the len()
method:
Example
Print the number of items in the tuple:
thistuple = ("apple", "banana", "cherry")
print(len(thistuple))
Try it Yourself »
To determine how many items a tuple has, use the len()
method:
Print the number of items in the tuple:
thistuple = ("apple", "banana", "cherry")
print(len(thistuple))
Try it Yourself »
If you want to report an error, or if you want to make a suggestion, do not hesitate to send us an e-mail:
help@w3schools.com
Your message has been sent to W3Schools.