input: Write a function to generate a histogram in Python using the data provided. The function should plot a histogram with specified bin ranges and labels for the x-axis and y-axis. The title of the histogram should be 'Histogram of data'.
  
  import matplotlib.pyplot as plt
  
  data = [3, 5, 7, 2, 8, 10, 11, 65, 72, 81, 99, 100, 150]
  
  def generate_histogram(data):
      plt.hist(data, bins=[0, 20, 40, 60, 80, 100, 120, 140, 160], edgecolor='black')
      plt.xlabel('Range of values')
      plt.ylabel('Number of Occurrences')
      plt.title('Histogram of data')
      plt.show()
  
  generate_histogram(data)
output: def generate_histogram(data):
      plt.hist(data, bins=[0, 20, 40, 60, 80, 100, 120, 140, 160], edgecolor='black')
      plt.xlabel('Range of values')
      plt.ylabel('Number of Occurrences')
      plt.title('Histogram of data')
      plt.show()