I'm taking a course on Coursera and doing an assignment after watching a teaching video. 
I wanna know why it shows "NameError: name 'histogram' is not defined" after running my own code.
You'll need to import the Histogram function as it is not built into Python. There are a few different packages that offer histograms -- for example pyplot and numpy. Here's an example using numpy
import numpy as np np.histogram([1, 2]) Documentation: https://numpy.org/doc/1.18/reference/generated/numpy.histogram.html
histogram()is not a built-in function, you need to define it.