mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
Correct typos in example code.
This commit is contained in:
parent
c99b675ff4
commit
ee1bded046
1 changed files with 3 additions and 3 deletions
|
@ -894,7 +894,7 @@ the same number of items as the slice it is replacing:
|
||||||
>>> a[::2] = [0,1,2]
|
>>> a[::2] = [0,1,2]
|
||||||
Traceback (most recent call last):
|
Traceback (most recent call last):
|
||||||
File "<stdin>", line 1, in ?
|
File "<stdin>", line 1, in ?
|
||||||
ValueError: attempt to assign list of size 3 to extended slice of size 2
|
ValueError: attempt to assign sequence of size 3 to extended slice of size 2
|
||||||
\end{verbatim}
|
\end{verbatim}
|
||||||
|
|
||||||
Deletion is more straightforward:
|
Deletion is more straightforward:
|
||||||
|
@ -1000,7 +1000,7 @@ KeyError: 4
|
||||||
>>> d.pop(1)
|
>>> d.pop(1)
|
||||||
Traceback (most recent call last):
|
Traceback (most recent call last):
|
||||||
File "stdin", line 1, in ?
|
File "stdin", line 1, in ?
|
||||||
KeyError: pop(): dictionary is empty
|
KeyError: 'pop(): dictionary is empty'
|
||||||
>>> d
|
>>> d
|
||||||
{}
|
{}
|
||||||
>>>
|
>>>
|
||||||
|
@ -1682,7 +1682,7 @@ objects:
|
||||||
'2002-12-30T21:27:03.994956'
|
'2002-12-30T21:27:03.994956'
|
||||||
>>> now.ctime() # Only available on date, datetime
|
>>> now.ctime() # Only available on date, datetime
|
||||||
'Mon Dec 30 21:27:03 2002'
|
'Mon Dec 30 21:27:03 2002'
|
||||||
>>> now.strftime('%Y %d %h')
|
>>> now.strftime('%Y %d %b')
|
||||||
'2002 30 Dec'
|
'2002 30 Dec'
|
||||||
\end{verbatim}
|
\end{verbatim}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue