Often, we’ll need to find the number of items in a list, usually called its length.
We can do this using the function
len. When we apply
len to a list, we get the number of elements in that list:
my_list = [1, 2, 3, 4, 5] print(len(my_list))
This would yield:
Calculate the length of
list1 and save it to the variable
range command that generates
list1 so that it skips
3 instead of
2 between items.
How does this change