Python Forum
How to aling the printing statements
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to aling the printing statements
#2
>>> import re
>>> pattern = re.compile('ab')
>>> matcher = pattern.finditer('zxaababaababa')
>>> for match in matcher:
...     print("starting index   ", str(match.start()).ljust(4,' ') + " End index ", str(match.end()).ljust(4,' '))
...
starting index    3    End index  5
starting index    5    End index  7
starting index    8    End index  10
starting index    10   End index  12
Reply


Messages In This Thread
How to aling the printing statements - by Mekala - May-14-2020, 01:23 PM
RE: How to aling the printing statements - by anbu23 - May-14-2020, 02:39 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  If & Else statements not printing. blackjesus24 3 2,605 Jan-22-2020, 04:43 PM
Last Post: blackjesus24

Forum Jump:

User Panel Messages

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