¡GoConqr estrena diseño! Cuéntanos qué te parece.

Módulo 9 de 24 · Texto

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: 

' '
" " 

Instrucciones

Para avanzar en el curso, envía un intento de este test. Puedes enviarlo después de la última pregunta.

Ir al módulo elegido

Escríbenos

¿Sobre qué es tu mensaje?

¿Qué te parece el nuevo diseño?

¿Te gusta?