total element in a list python code example
Example 1: length of list python
thistuple = ("apple", "banana", "cherry")
print(len(thistuple))
Example 2: number of elements list python
>>> mylist = [1,2,3] #list
>>> len(mylist)
3
>>> word = 'hello' # string
>>> len(word)
5
>>> vals = {'a':1,'b':2} #dictionary
>>> len(vals)
2
>>> tup = (4,5,6) # tuple
>>> len(tup)
3