Skip to content

Commit d0ef193

Browse files
committed
Don't use %-formatting syntax for str.format().
1 parent 7b7726d commit d0ef193

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/maintainability/returning_more_than_one_variable_type_from_function_call.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ In the module below, the function ``get_secret_code()`` returns a secret code wh
4141
if secret_code == None:
4242
print "Wrong password."
4343
else:
44-
print "The secret code is %s".format(secret_code)
44+
print "The secret code is {}".format(secret_code)
4545
4646
4747
Solutions
@@ -62,7 +62,7 @@ When a calling module provides invalid data to a function, or a precondition to
6262
6363
try:
6464
secret_code = get_secret_code("unicycle")
65-
print "The secret code is %s".format(secret_code)
65+
print "The secret code is {}".format(secret_code)
6666
except ve as ValueError:
6767
print "Wrong password."
6868

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy