Commit 0ba58158 authored by Fred Drake's avatar Fred Drake

Added "import string" to a couple of examples that describe string

module functions, to clarify that the import is not automatic.
Suggested by Koray Oner <Koray.Oner@Eng.Sun.COM>.
parent fa4eb188
...@@ -572,6 +572,7 @@ the first line above could also have been written \samp{word = 'Help' ...@@ -572,6 +572,7 @@ the first line above could also have been written \samp{word = 'Help'
expressions: expressions:
\begin{verbatim} \begin{verbatim}
>>> import string
>>> 'str' 'ing' # <- This is ok >>> 'str' 'ing' # <- This is ok
'string' 'string'
>>> string.strip('str') + 'ing' # <- This is ok >>> string.strip('str') + 'ing' # <- This is ok
...@@ -2387,6 +2388,7 @@ numeric string on the left with zeros. It understands about plus and ...@@ -2387,6 +2388,7 @@ numeric string on the left with zeros. It understands about plus and
minus signs: minus signs:
\begin{verbatim} \begin{verbatim}
>>> import string
>>> string.zfill('12', 5) >>> string.zfill('12', 5)
'00012' '00012'
>>> string.zfill('-3.14', 7) >>> string.zfill('-3.14', 7)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment