Why does this not work in Spyder


This works in Codecademy but not in Spyder, a separate IDE


Hi @elainalin,

If you are using Python 3, then print is a function, requiring parentheses. Instead of ...

print str(pi)

... you need ...



Thank you! I also thought that for str(), it automatically adds the parentheses? But it doesn't print as "3.14"

So what makes 3.14 a string and not an integer then when it is printed?


The str function performs that conversion. However, when a str is output, the quotes are not displayed.

Though the purpose of the conversion might not be obvious in this exercise, you will be able to observe in later exercises that it is sometimes useful to convert objects to a str type.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.