8. str() Need help finding what I'm doing wrong


#1

<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>
https://www.codecademy.com/courses/python-beginner-sRXwR/1/4?curriculum_id=4f89dab3d788890003000096
<In what way does your code behave incorrectly? Include ALL error messages.>
Oops, try again. pi should equal the number 3.14–do not call str(pi) until after the print command on line 5!
<What do you expect to happen instead?>
I assumed this is what I was supposed to write after following the directions. What is incorrect?

```python

pi = “3.14”
print str(pi)

<do not remove the three backticks above>

#2

Hi there,
@bitblaster99120
Indeed you will get such error, because you are assigning the ‘string’ value into pi variable and again converting into ‘string’.

To avoid such error please change the code
pi = “3.14”
to
pi = 3.14

Happy coding…


#3

“Oops, try again. pi should equal the number 3.14–do not call str(pi)”

pi should be equal to number 3.14 (The code asks you to input it as integer), not string.

So if you surround 3.14 with " " you will make 3.14 as a string, and the next line of code you convert it to string (again), so it raise an error