Question:

Given the following statement:
import matplotlib.pyplot as plt 
'plt' in the above statement is .............. name.

Show Hint

The \texttt{as} keyword in Python is used to define an alias for imported modules. This helps shorten module names for ease of use.
Updated On: Sep 18, 2025
  • key
  • alias
  • variable
  • function
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is B

Solution and Explanation

Step 1: Understanding the import statement.
In Python, the \texttt{import} statement allows us to bring in libraries or modules into our script. When importing, you can assign a shorthand name (alias) to the module using \texttt{as}. This helps in reducing the need to reference the entire module name repeatedly.
Step 2: Evaluate each option.
- Option (A) Key: In Python, a key usually refers to the key in a dictionary. This is not applicable here. - Option (B) Alias: The \texttt{plt} in this case is the alias for the \texttt{matplotlib.pyplot} module, making this the correct answer. - Option (C) Variable: A variable holds a value or object, which is not the case here. - Option (D) Function: A function in Python is defined using the \texttt{def} keyword, which is not the case for \texttt{plt}.
Step 3: Conclusion.
The \texttt{plt} in the statement is an alias for the \texttt{matplotlib.pyplot} module.
Final Answer: \[ \boxed{\text{plt is an alias for the matplotlib.pyplot module.}} \]
Was this answer helpful?
0
0

Questions Asked in CUET exam

View More Questions