Multi-Line strings


#1

An inauspicious start as I have trouble on every page in my first attempt with Python.

I am at Multi-Line strings - 11/14 of the first lesson.

The instructions say,

Create a variable called haiku and store this haiku as a multi-line string:

    The old pond,
    A frog jumps in:
    Plop!

What’s wrong with my code?

haiku = """The old pond, 
A frog jumps in: 
Plop!""" 

The error message says:

Your haiku was: The old pond,
A frog jumps in:
Plop!, we expected: The old pond,
A frog jumps in:
Plop!

Looks exactly the same to me.
Please advise.


Why is total_cost a float?
#2

Your code looks fine, so it could be a quirk in the SCT or the interface, itself. Try a page refresh and Run your code again. If that still won’t work, then Reset the lesson, and try entering code with only single quotes.

haiku = '''...
...
...'''

Addendum

If need be, try to print the haiku to the console see if that shakes the cobwebs free.


#3

I’m having the same problem. Tried above, didn’t work.


#4

I just reset the lesson and tried the following…

haiku = '''The old pond,
A frog jumps in:
Plop!'''

print haiku

and it passed.


#5

Lucky you!
I’m still having the same problem…
Refreshed, reset, same code, same error message:
“Your haiku was: The old pond,
A frog jumps in:
Plop!, we expected: The old pond,
A frog jumps in:
Plop!”

I am able to print the haiku to the console, but I still have the same error.
I also tried single quotes and got additional errors.

I think I’ll work on something else today and start Python over completely another time.


#6

I am also having this issue and other exercices keep giving an error even though the code is absolutely correct. Changing browsers did nothing, and cannot find an answer anywhere else on the web. Is there any way to fix this at all?


#8

well when you refresh or go back and come forward it automatically takes that the code is correct ( i checked it ) I don’t know about yours but it happens in mine so refreshing it is not gonna help you learn it


#9

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