Tag Archives: for statement with in

Strings | Triple-quoted strings, for statement with in, conversion, changing strings

Triple-quoted strings

Triple-quoted strings are useful when you need multiline text in your program, for documentation strings (which are string literals that are taken as comments when they appear at specific points in your file), and as a way to temporarily disable lines of code during development.

>>> string1 = '''This is 
... a three line
... string'''
>>> string1
'This is \na three line\nstring'
>>> print(string1)
This is 
a three line
string

Continue reading