Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Find the length of a nested list in python

nestedList = [‘Krishna’, 20, ‘John’, [20, 40, 50, 65, 22], ‘Yung’, 11.98]
print(“
 Original List = “, nestedList)
print(“Length of a Nested List = “, len(nestedList[3]))
output:
Original List = [‘Krishna’, 20, ‘John’, [20, 40, 50, 65, 22], ‘Yung’, 11.98]
Length of a Nested List = 5
Source by www.howtouselinux.com #
 
PREVIOUS NEXT
Tagged: #Find #length #nested #list #python
ADD COMMENT
Topic
Name
8+8 =