Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions book/ch03.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2259,6 +2259,7 @@ must be called with exactly the same number of arguments.

Arguments to ``format()`` are consumed left to right, and any
superfluous arguments are simply ignored.

>>> '{} wants a {}'.format ('Lee', 'sandwich', 'for lunch')
'Lee wants a sandwich'

Expand Down
2 changes: 1 addition & 1 deletion book/ch07.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1177,7 +1177,7 @@ The listing in code-traverse_ demonstrates this.
traverse(child)
print(')', end=" ")

>>> t = nltk.Tree('(S (NP Alice) (VP chased (NP the rabbit)))')
>>> t = nltk.Tree.fromstring('(S (NP Alice) (VP chased (NP the rabbit)))')
>>> traverse(t)
( S ( NP Alice ) ( VP chased ( NP the rabbit ) ) )

Expand Down