Skip to content

Commit d0ef193

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

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

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)