Matplotlib error

I was trying this simple code and am unable to find the error I made in it.

My code:

import matplotlib.pyplot as plt
import numpy as np
x = ['Python','C++','Java','Pearl','Lisp']
y = [10,8,6,4,2,1]
plt.bar(x, y,align='edge',color='orange')
plt.show()


And I am getting the error:

ValueError: shape mismatch: objects cannot be broadcast to a single shape


Because you're giving x with a shape of (5,) and y with a shape of (6,). Removing the last item from y to make them of equal length works without an error:
import matplotlib.pyplot as plt