Here we assigned return values of hist to be n1,b1,p1.
n1 and b1 are often useful. Add some print statements and see if you can figure out what they are.
weights=weights1 here we are multiplying the count number (y-axis) by 1. (Its really doing nothing). However, weights=weights2 is multiplying the count number with (1/length of array) (with this we are plotting P(x)).
alpha =0.5 is setting the transparency level of the histogram. It ranges between 0-1. (change the value of alpha to see the effect)