[Python-checkins] bpo-34161: Remove extra parentheses in output formatting tutorial (GH-8350)
Mariatta
webhook-mailer at python.org
Fri Jul 20 16:38:14 EDT 2018
https://github.com/python/cpython/commit/49abd307d222e6fe85b5175eed6b6f87fc656a8d
commit: 49abd307d222e6fe85b5175eed6b6f87fc656a8d
branch: 3.7
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: Mariatta <Mariatta at users.noreply.github.com>
date: 2018-07-20T13:38:06-07:00
summary:
bpo-34161: Remove extra parentheses in output formatting tutorial (GH-8350)
The parentheses were incorrect.
(cherry picked from commit cb5f3fdb9d353a572dd22fb50a110e52d5bb81b1)
Co-authored-by: Aaqa Ishtyaq <aaqaishtyaq at gmail.com>
files:
M Doc/tutorial/inputoutput.rst
diff --git a/Doc/tutorial/inputoutput.rst b/Doc/tutorial/inputoutput.rst
index 417c3b1319c0..dfe4c3849cbe 100644
--- a/Doc/tutorial/inputoutput.rst
+++ b/Doc/tutorial/inputoutput.rst
@@ -41,8 +41,8 @@ printing space-separated values. There are several ways to format output.
::
>>> yes_votes = 42_572_654 ; no_votes = 43_132_495
- >>> percentage = (yes_votes/(yes_votes+no_votes)
- >>> '{:-9} YES votes {:2.2%}'.format(yes_votes, percentage))
+ >>> percentage = yes_votes/(yes_votes+no_votes)
+ >>> '{:-9} YES votes {:2.2%}'.format(yes_votes, percentage)
' 42572654 YES votes 49.67%'
* Finally, you can do all the string handling yourself by using string slicing and
More information about the Python-checkins
mailing list