Difference between revisions of "Code Snippet: Long Strings"
From Coder Merlin
NerdOfLinux (talk | contribs) |
|||
Line 14: | Line 14: | ||
== Python == | == Python == | ||
<syntaxhighlight lang="python"> | |||
longString = """We the People of the United States, in Order to form a more perfect Union, establish Justice, | |||
insure domestic Tranquility, provide for the common defence, promote the general Welfare, and | |||
secure the Blessings of Liberty to ourselves and our Posterity, do ordain and establish this | |||
Constitution for the United States of America.""" | |||
print(longString) | |||
</syntaxhighlight> |
Latest revision as of 17:35, 24 December 2018
Within these castle walls be forged Mavens of Computer Science ...
— Merlin, The Coder
Long String Literals[edit]
Swift[edit]
let longString = """
We the People of the United States, in Order to form a more perfect Union, establish Justice,
insure domestic Tranquility, provide for the common defence, promote the general Welfare, and
secure the Blessings of Liberty to ourselves and our Posterity, do ordain and establish this
Constitution for the United States of America.
"""
print(longString)
Python[edit]
longString = """We the People of the United States, in Order to form a more perfect Union, establish Justice,
insure domestic Tranquility, provide for the common defence, promote the general Welfare, and
secure the Blessings of Liberty to ourselves and our Posterity, do ordain and establish this
Constitution for the United States of America."""
print(longString)