Complete the code to import the matplotlib plotting library.
import [1] as plt
We import matplotlib.pyplot as plt to create line plots.
Complete the code to plot a line graph of y values.
plt.[1]([1, 2, 3, 4], [10, 20, 25, 30]) plt.show()
The plot function draws line plots connecting points.
Fix the error in the code to correctly label the x-axis.
plt.plot([1, 2, 3], [4, 5, 6]) plt.xlabel([1]) plt.show()
Axis labels must be strings, so use quotes around the label text.
Fill both blanks to create a dictionary comprehension that maps words to their lengths only if length is greater than 3.
{word: [1] for word in words if [2]The dictionary maps each word to its length, but only includes words longer than 3 characters.
Fill all three blanks to create a dictionary comprehension that maps uppercase words to their counts only if count is positive.
{ [1]: [2] for [3] in data.items() if [2] > 0 }This comprehension creates a dictionary with uppercase words as keys and their counts as values, including only positive counts.