Multiline Strings in Python

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/multiline-strings-python/
PINTEREST
PINTEREST
INSTAGRAM

Python supports different type and format strings. In this tutorial we will simply look multi line strings. We have following code and want to type it in single expression in multi line.

Double Quote

We can use double quote by wrapping multiple lines. This will legal for python programming. And we can end the string whenever we want like below.

Single Line

We can write a string in a single line line below.

EOF

EOF is special keyword used to specify multi line strings. The start of the multiline string is marked with <<< EOF and then the string will be given. We also need to specify the end of the string with EOF too like below.

 

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/multiline-strings-python/
PINTEREST
PINTEREST
INSTAGRAM

LEARN MORE  How To Prevent Sql Injection in Php Applications?

You may also like...

Leave a Reply

Your email address will not be published.

Enjoy this blog? Please spread the word :)