Unable to resolve 'str' object not callable error

Screen Link:
https://app.dataquest.io/m/305/the-mean/8/estimating-the-population-mean

I mistakenly ran the wrong syntax plt.xlabel = 'Sample size', which converted the plt.xlabel attribute to a string and resulted in a 'str' object not callable error.

Now, I am trying to run the correct syntax plt.xlabel('Sample size') after restoring the initial code but I am getting the same error.

Please help!

1 Like

It worked when I ran it after my code having the same syntax had worked on the next screen.

1 Like

Hi @aditya.rawal23,

If this happens again, here is a workaround:

Best,
Sahil

2 Likes