assigning multi-line strings to variables
ben+python at benfinney.id.au
Wed Apr 28 05:24:49 CEST 2010
goldtech <goldtech at worldpost.com> writes:
> Only seems to work when there's a '... ' on the 2nd line.
You seem to be confused by the presentation of the interactive
interpreter. That text is a prompt.
> I need a way to assign large blocks of text to a variable w/out
> special formatting.
That's what triple-quoted string syntax is for.
You would do well to work through the entirety of the Python tutorial
<URL:http://docs.python.org/tutorial/>. Take the time to actually
perform each exercise and experiment until you understand the concept
being presented, before moving on.
\ “I find the whole business of religion profoundly interesting. |
`\ But it does mystify me that otherwise intelligent people take |
_o__) it seriously.” —Douglas Adams |
More information about the Python-list