[ACCEPTED]-write a paragraph to a file-python
Accepted answer
f.write("""I’ve got a lovely bunch of coconuts
There they are all standing in a row
Big ones, small ones, some as big as your head
Give them a twist a flick of the wrist
That’s what the showman said""")
0
You can use the 3 quote string declaration 1 like so.
>>> a = '''blah blah blah blah
blah blah blah blah
blah blah blah blah'''
>>> print(a)
blah blah blah blah
blah blah blah blah
blah blah blah blah
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.