python how to get number of strings in a list 1

python how to get number of strings in a list

list_a = ["Hello", 2, 15, "World", 34]

number_of_elements = len(list_a)

print(number_of_elements)

Here is what the above code is Doing:
1. We create a list called list_a.
2. We use the len() function to get the number of elements in list_a.
3. We print the number of elements in list_a.

Similar Posts