String and interger


#1


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

It says that I am printing it out wrong but it prints out the way it is suppose to be.


# Turn 3.14 into a string on line 3!
pi = 3.14
pi = str(pi)
print( "The value of pi is around " + pi + "\".")


#2

why do you have this:

+ "\"."

printing more then the string asked for by the instructions can give an error


#3

because they are asking for "The value of pi is around 3.14". The back slash allows for " to be used in string at the end of 3.14


#4

This code gives me what they ask for
pi = 3.14
pi = str(pi)
print( "\"The value of pi is around " + pi + "\".")
but I still get an error


#5

the quotation marks (") used in the example simply mark the beginning and end of string, you don't actually have to print them


#6

Ok I took them out. My code is now: print( "The value of pi is around " + pi + "."). But I still get error message: Oops, try again. It looks like you printed "The value of pi is around 3.14." instead of "The value of pi is around 3.14".


#7

the string printed needs to be an exact match, there shouldn't be a full stop after 3.14

the full stop in the instruction is clearly after the quotation mark that closes the string


#8

Ok thank I got it. Little confusing. I removed the . and it worked thank you


#9