Fill in the missing code

Report a typo

Let's say we want to display the percentages in the pie chart, rounded to 2 decimal places.

Specify the autopct parameter in the given snippet so that it results in a plot below:

import matplotlib.pyplot as plt

plt.pie([1521.16, 253.45, 333.99, 215.50], 
        labels=['Household', 'Healthcare', 'Entertainment', 'Misc.'], 
        # your code here 
        )

plt.show()

Fill the autopct parameter to get the pie chart

The answer should be in the following format:

autopct = ...
Hint

Take a closer look at the Display the value section of the theory

Enter a short text
___

Create a free account to access the full topic