String conversion


#1

I keep getting an error message whenever I try to make numbers a string. It let me continue to the next lesson, but I am seriously trying to learn so I want to know what I am doing wrong here. I typed exactly as pictured above.

Traceback (most recent call last):
File "python", line 3, in
TypeError: 'str' object is not callable


A question on Explicit String Conversion
#2

impossible to tell without your code


#3

3 print "The value of pi is around " + str(3.14)


#4

ran the code here, everything works fine?


#5

It did indeed work there, but it did not work in the lesson. weird.


#6

You should click on reset code button and then re-type the code. It will work.
Or
You can store str(3.14) in some other variable and then print that variable along with message


#7

Try refreshing the page? Otherwise please post a screenshot of the code in the lesson that produces an error


#8

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