How to get the number of elements in a list in Python

Use the len() built-in function to get the number of items in list.

car_brands = ['bmw', 'ferrari', 'mclaren']

print(len(car_brands))
3