8.) str() passes code but no quotations around the code?


In the example given in this lesson, I would have assumed that after str(pi) I would have gotten "3.14" but it just gave 3.14 back to me. Was I wrong to assume that or did I do something wrong?

pi = 3.14

print str(pi)


This is my code:

"""Declare and assign your variable on line 4,
then call your method on line 5!"""

pi = 3.14
print str(pi)


Well I understand the code and I passed the lesson with my code (since ours is the same) but yet no quotation marks appear and I would still like that explained if possible


That is because for example print str(abc) = print "abc" and there are no quotation marks because only text will be printed


Thank you very much!


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