A. Using assignment operator '=' instead of function call for plt.title
B. Missing plt.show() call
C. Incorrect order of xlabel and ylabel calls
D. plt.plot() arguments are invalid
Solution
Step 1: Check how title is set
The code uses plt.title = 'My Plot' which assigns a string to the function name, overwriting it instead of calling it.
Step 2: Understand correct usage
The correct way is to call the function: plt.title('My Plot') to set the title.
Final Answer:
Using assignment operator '=' instead of function call for plt.title -> Option A
Quick Check:
Title must be set by calling plt.title() [OK]
Hint: Use parentheses () to call plt.title() function [OK]
Common Mistakes:
Assigning string to plt.title instead of calling
Forgetting plt.show()
Swapping xlabel and ylabel calls
5. You want to create a plot with the title 'Temperature Trends', x-axis labeled 'Day', and y-axis labeled 'Temperature (°C)'. Which code snippet correctly achieves this?