Kaydet (Commit) 9c27c18c authored tarafından Berker Peksag's avatar Berker Peksag

Issue #23116: Merge from 3.5

......@@ -364,7 +364,7 @@ The most useful form is to specify a default value for one or more arguments.
This creates a function that can be called with fewer arguments than it is
defined to allow. For example::
def ask_ok(prompt, retries=4, complaint='Yes or no, please!'):
def ask_ok(prompt, retries=4, reminder='Please try again!'):
while True:
ok = input(prompt)
if ok in ('y', 'ye', 'yes'):
......@@ -373,8 +373,8 @@ defined to allow. For example::
return False
retries = retries - 1
if retries < 0:
raise OSError('uncooperative user')
print(complaint)
raise ValueError('invalid user response')
print(reminder)
This function can be called in several ways:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment