Quotation in Python:
Some of us (including me) are confuse and did not know that actually Python accepts single ('), double (") and triple (''' or """) quotes to denote string literals !
BUT! It comes with rules : as long as the same type of quote starts and ends the string :)
The triple quotes can be used to span the string across multiple lines.
For example:
word = 'word' sentence = "This is a sentence." paragraph = """This is a paragraph. It is made up of multiple lines and sentences."""
credit to: http://www.tutorialspoint.com/python/python_quick_guide.htm
No comments:
Post a Comment