Error using str.format()

Screen Link:

My Code:

artist = "Pablo Picasso"
birth_year = 1881

template = "{}'s birth year is {}"
output = template.format(artist, birth_year)
print(output)

What I expected to happen:

Pablo Picasso’s birth year is 1881

What actually happened:

TypeErrorTraceback (most recent call last)
<ipython-input-1-d0bcf2734c8a> in <module>()
      4 template = "{}'s birth year is {}"
      5 output = template.format(artist, birth_year)
----> 6 print(output)

TypeError: 'str' object is not callable

I’m not sure where is the error

Even the answer presented result in a error

artist = "Pablo Picasso"
birth_year = 1881
template = "{name}'s birth year is {year}"
output = template.format(name=artist, year=birth_year)
print(output)

@m.frias, welcome to the community!

Your code works fine for me,

You should try to refresh the page or click the recycle icon beside the submit answer button and then type your code again.

Yes it is weird. I’ve try that but still doesn’t work. I have close my brower and open it again but still no solution.

The console also shows the same error:

I think there is a problem with the VM @doyinsolamiolaoye

I’m also getting the error in 311-7:

@m.frias,
Yeah I think so. The last time something like this happened to me, Clicking the recycle icon beside the submit button and typing my code again resolved it for me.

If it persists you could file a ticket here in this regard.

1 Like

Hey guys. You may also want to check out this post and see if that helps resolve the issue:

If not, then filling out a ticket is a good idea.

Yes, your totatly correct. I found out that I wrote print = somewhere along the missions. I had to reset every single mission in the 331 module to correct it. Thank you.

Oh, thank you @april.g.

@m.frias, I think you marked a different reply as the solution.