summaryrefslogtreecommitdiffstats
path: root/Doc/howto
diff options
context:
space:
mode:
authorSkip Montanaro <skip.montanaro@gmail.com>2022-11-03 02:08:08 (GMT)
committerGitHub <noreply@github.com>2022-11-03 02:08:08 (GMT)
commit1fd20d0b57478d8b0d8d58718fa773135348bf98 (patch)
treec0167d3326185e49b8a2455c3f409a5ea0969c34 /Doc/howto
parentc053284e3930027847d5adf99efcb1aa5ccbacd1 (diff)
downloadcpython-1fd20d0b57478d8b0d8d58718fa773135348bf98.zip
cpython-1fd20d0b57478d8b0d8d58718fa773135348bf98.tar.gz
cpython-1fd20d0b57478d8b0d8d58718fa773135348bf98.tar.bz2
argparse howto: Use f-string in preference to "...".format() (#98883)
Diffstat (limited to 'Doc/howto')
-rw-r--r--Doc/howto/argparse.rst4
1 files changed, 2 insertions, 2 deletions
diff --git a/Doc/howto/argparse.rst b/Doc/howto/argparse.rst
index f3ad117..f4d08e7 100644
--- a/Doc/howto/argparse.rst
+++ b/Doc/howto/argparse.rst
@@ -761,9 +761,9 @@ your program, just in case they don't know::
if args.quiet:
print(answer)
elif args.verbose:
- print("{} to the power {} equals {}".format(args.x, args.y, answer))
+ print(f"{args.x} to the power {args.y} equals {answer}")
else:
- print("{}^{} == {}".format(args.x, args.y, answer))
+ print(f"{args.x}^{args.y} == {answer}")
Note that slight difference in the usage text. Note the ``[-v | -q]``,
which tells us that we can either use ``-v`` or ``-q``,