Skip to content

Commit 0b4101e

Browse files
committed
Merge pull request quantifiedcode#5 from Trundle/return_example_fixes
Small corrections for "Returning more than one variable type from function call"
2 parents 4d1b474 + d248885 commit 0b4101e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/maintainability/returning_more_than_one_variable_type_from_function_call.rst

Lines changed: 3 additions & 3 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,8 +62,8 @@ 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)
66-
except ve as ValueError:
65+
print "The secret code is {}".format(secret_code)
66+
except ValueError:
6767
print "Wrong password."
6868
6969
References

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