Complete the code to import the matplotlib.pyplot module as plt.
import [1] as plt
We import matplotlib.pyplot as plt to create plots.
Complete the code to create a bar chart with error bars using plt.bar.
plt.bar(x, height, yerr=[1])The yerr parameter takes the error values to show error bars.
Fix the error in the code to correctly display error bars on the bar chart.
plt.bar(x, height, yerr=[1], capsize=5) plt.show()
The variable holding error values is named errors. Using the correct variable name fixes the error.
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 using len(word). The condition keeps 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 greater than 0.
{ [1]: [2] for [3], count in data.items() if count > 0 }count.upper() which is invalid since count is a number.The keys are uppercase words using word.upper(). The values are counts. The loop variable is word.