Given the following statement:
import matplotlib.pyplot as plt
'plt' in the above statement is ___ name.
Given the following statement:
import matplotlib.pyplot as plt
'plt' in the above statement is ___ name.
Solution
✅ Correct Option: 2
The as keyword in import ... as ... gives the imported module a shorter alternative name. Here plt is an alias for matplotlib.pyplot, so matplotlib.pyplot.plot() can be written as plt.plot().
Option 3: plt does hold a reference to the module, but Python's term for a name given with as in an import is an alias, not a variable.
Option 4: plt refers to a module, not a function. The functions, such as plot(), are called through it as plt.plot().
Related questions:
2026: 13 May Shift 2
2026: 23 May Shift 1
2026: 21 May Shift 1