Where did I go wrong?


#1



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


I did what I wanted to do and I pressed Save and Submit Code and it said that it was wrong. So then I viewed the hint and did what the hint said to do and then it said it was wrong again. Please help!


I expected it to be right.


# The string below is broken. Fix it using the escape backslash!

\'This isn't flying, this is falling with style!\'


#2

Hi @gnithya ,

Escape the ' character that is contained within the string, rather than the ones that delimit the beginning and end of the string.


#3

I don't really get what you mean. Should I only insert a backslash in one place?


#4

With three single quotes Python thinks your string is "This isn" - because the string starts with the first single quote before the T in This, and ends with the second single quote after the n in isn't(but it doesn't recognize the t in isn't because it thinks the string has ended).

'This isn't flying, this is falling with style!'

So put the escape character before the single quote in the word isn't

'This isn\'t flying, this is falling with style!'

and it will know your string is the full sentence

"This isn't flying, this is falling with style!"

#5

Yes. Also see @zh30 's response.


#6

Thank you so much! This worked!


#7

the ' in isn't shouldn't be there so put a back slash before it this isn\'t flying


#8

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