how to find out how long a awray in python code example
Example 1: python list length
# example of len() function
list_number = [6, 3, 8, 0]
length = len(list_number)
print("The lentgh of the list is: " + str(length))
Example 2: python strlen
# to get the length of a string or array, use the len() method
my_string = "Hello World"
my_list = ["apple", "banana", "orange"]
print(len(my_string)) # outputs 11
print(len(my_list)) # outputs 3