Python Forum
Put each word in a quote in a new line in printout
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Put each word in a quote in a new line in printout
#6
I think that most concise is to print split-uncpack with newline separator:

>>> quote = "they stumble who run fast"
>>> print(*quote.split(), sep='\n')
they
stumble
who
run
fast
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy

Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Reply


Messages In This Thread
RE: Put each word in a quote in a new line in printout - by perfringo - Apr-15-2019, 07:08 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020