input: Write a function to generate a histogram from the given data using Python. The function should plot the data with specified bin ranges, labels, and title, and then display the histogram. If the input data is empty, the function should print "No data to plot" and return.
  
  def generate_histogram(data):
      if len(data) == 0:
          print("No data to plot")
          return
      import matplotlib.pyplot as plt
  
      # plotting the histogram 
      plt.hist(data, bins = [0, 20, 40, 60, 80, 100, 120, 140, 160], edgecolor = 'black') 
        
      # x-axis label 
      plt.xlabel('Range of values') 
      # y-axis label 
      plt.ylabel('Number of Occurrences') 
      # plot title 
      plt.title('Histogram of data') 
        
      # function to show the plot 
      plt.show()
  
  assert generate_histogram([3, 5, 7, 2, 8, 10, 11, 65, 72, 81, 99, 100, 150]) is None
  assert generate_histogram([]) is None
output: def generate_histogram(data):
      if len(data) == 0:
          print("No data to plot")
          return
      import matplotlib.pyplot as plt
  
      # plotting the histogram 
      plt.hist(data, bins = [0, 20, 40, 60, 80, 100, 120, 140, 160], edgecolor = 'black') 
        
      # x-axis label 
      plt.xlabel('Range of values') 
      # y-axis label 
      plt.ylabel('Number of Occurrences') 
      # plot title 
      plt.title('Histogram of data') 
        
      # function to show the plot 
      plt.show()