Complete the code to enable inline plotting in a Jupyter notebook.
%[1] matplotlib inlineThe magic command %matplotlib inline enables plots to be shown inside the notebook.
Complete the code to import the plotting library commonly used with inline display.
import [1] as plt
matplotlib.pyplot is the module used for plotting in Python and is commonly imported as plt.
Fix the error in the code to display a simple plot inline.
plt.plot([1, 2, 3], [4, 5, 6]) plt.[1]()
The plt.show() function displays the plot in the output cell.
Fill both blanks to create a dictionary comprehension that maps numbers to their squares and filters for squares greater than 10.
{x: x[1]2 for x in range(1, 6) if x[2]2 > 10}The operator ** is used for exponentiation (power), and * is multiplication. The condition checks if the square (x * 2) is greater than 10.
Fill all three blanks to create a dictionary comprehension that maps uppercase words to their lengths, filtering words longer than 3 characters.
{ [1]: [2] for word in words if len(word) [3] 3 }The dictionary keys are uppercase words (word.upper()), values are their lengths (len(word)), and the filter keeps words longer than 3 characters (> 3).