Simple Bar Chart

why not use len(drinks) in the exercise of plotting bar?

plt.bar(range(len(drinks)), sales)

Please include a link to the exercise when querying a specific task from a lesson. I’m guessing this is matplotlib so consider what len(list) actually returns. Why would range then actually make sense for the x co-ordinates?

https://www.codecademy.com/paths/visualize-data-with-python/tracks/graphing-in-python-dvp/modules/matplotlib-dvp/lessons/matplotlib-ii/exercises/basic-bar-chart-ii

Cheers, best to include it with any specific queries in the future. Based on my previous message do you now understand why range(len(values)) was used instead of len(values)?

Thank you. I got it.