import matplotlib.pyplot as plt
In the above statement 'plt' is ________
import matplotlib.pyplot as plt
In the above statement 'plt' is ________
Solution
The keyword as in an import statement gives the imported module a shorter name. Here plt is an alias for the module matplotlib.pyplot, so you can write plt.plot() instead of matplotlib.pyplot.plot().
Option 4: plt.plot() and plt.show() are functions, but plt itself stands for the whole module, not a function.
Options 2 and 3: plt is not a class or an interface, because it is just another name for a module.
The alias name is only a convention. plt is the standard choice for matplotlib.pyplot, just as np is for NumPy and pd is for pandas.
Related questions:
2026: 19 May Shift 1
2026: 20 May Shift 1
2026: 11 May Shift 2
2026: 20 May Shift 1
2026: 29 May Shift 2