Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 23157e5

Browse files
committed
Further beautification of the example
1 parent 9c47d77 commit 23157e5

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

Doc/library/re.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1331,12 +1331,15 @@ successive matches::
13311331
if pos != len(s):
13321332
raise RuntimeError('Unexpected character %r on line %d' %(s[pos], line))
13331333

1334-
>>> statements = '''\
1334+
statements = '''\
13351335
total := total + price * quantity;
13361336
tax := price * 0.05;
13371337
'''
1338-
>>> for token in tokenize(statements):
1339-
print(token)
1338+
1339+
for token in tokenize(statements):
1340+
print(token)
1341+
1342+
The tokenizer produces the following output::
13401343

13411344
Token(typ='ID', value='total', line=1, column=8)
13421345
Token(typ='ASSIGN', value=':=', line=1, column=14)

0 commit comments

Comments
 (0)