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


#1

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)


#2

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)


#3

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


#4

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


#5

Thank you very much!


#7

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