Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to find the length of a list in python

# It doesn't matter what is the type of the item
# It will count the number of items in the list
x = [1, 2, 5.67, 2.45, 'John', 'Pat', True, False]
length = len(x)	# This gives us an integer
print('number of items in the list is:', length)
Source by www.howtouselinux.com #
 
PREVIOUS NEXT
Tagged: #find #length #list #python
ADD COMMENT
Topic
Name
1+5 =