len()
` to get the length of a list in Python. Here's an example program:my_list = [1, 2, 3, 4, 5]
length = len(my_list)
print("The length of the list is:", length)
The length of the list is: 5
my_list
` containing five elements. Then, we use the `len()
` function to get the length of the list and store it in a variable called `length
`. Finally, we print out the length of the list using the `print()
` function.