GoConqr hat ein neues Design! Sag uns, wie es dir gefällt.

Modul 9 von 24 · Text

Coding strings

David Khieu

Coding strings

Now the next question is: how do you embed an apostrophe into a string placed between apostrophes? 

You should already know the answer, or to be precise, two possible answers. 

Try to print out a string containing the following message: 

I'm Monty Python. 

Do you know how to do it? Click Check below to see if you were right: 

print('I\'m Monty Python.')

or

print("I'm Monty Python.")

As you can see, the backslash is a very powerful tool - it can escape not only quotes, but also apostrophes. 

We've shown it already, but we want to emphasize this phenomenon once more - a string can be empty - it may contain no characters at all. 

An empty string still remains a string: 

' '
" " 

Anleitung

Um im Kurs weiterzukommen, sende einen Versuch dieses Quiz ab. Du kannst ihn nach der letzten Frage absenden.

Zum gewählten Modul

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck