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


#1



https://www.codecademy.com/courses/python-beginner-sRXwR/1/4?curriculum_id=4f89dab3d788890003000096

Oops, try again. pi should equal the number 3.14--do not call str(pi) until after the print command on line 5!

I assumed this is what I was supposed to write after following the directions. What is incorrect?


 pi = "3.14"
print str(pi)


#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