Str()


#1

The instructions are:

Create a variable pi and set it to 3.14 on line 4.
Call str(pi) on line 5, after print.
I am doing this and it says "Did you create a variable called pi?

1 """Declare and assign your variable on line 4,
2 then call your method on line 5!"""
3
4 pi = "3.14" (Instruction 1)
5 print "3.14"str(pi) (Instruction 2)

I do not know what I am doing wrong, please help! No.4 and No.5 is what I typed into the code


#3

Hello, thank you for your response but the code is still not correct.

on line 4 and 5 i typed:

pi = 3,14
print str(pi)


Then it says "Oops, try again. It looks like pi is (3, 14) instead of 3.14."


on line 4 i type:

pi = 3.14.


and it says:

Oops, try again. Your code looks a bit off. Check the Hint if you need help! Your code threw the following error: invalid syntax (python, line 4)


I decide to put " " between 3.14. so it would look like "3.14." The code turns green.


Now it says: "Oops, try again. It looks like pi is 3.14. instead of 3.14."


So I think I am doing this correctly and there is a bug or something.

Thanks again for your help.


#4

Hi the other one did work because of "," between 3 and 14 so her thatr one should works

pi = 3.14
print str(pi)

#5

oh okay lol thank you! But why shouldn't it be in quotes?


#6

because with number you didn't quotes only when you type sentence


#7

alright Thank you that makes sense