Function returns old value

dn PythonList at DancesWithMice.info
Fri Dec 11 21:21:29 EST 2020


On 12/12/2020 15:09, Bischoop wrote:
> On 2020-12-12, dn <PythonList at DancesWithMice.info> wrote:
>> On 12/12/2020 14:25, Bischoop wrote:
>>>
>>>
>>>
>>> I've function asking question and comparing it, if is not matching 'yes'
>>> it does call itself to ask question again. The problem is that when
>>> function is called second time it returns old value or with additional
>>> else statement it returns none.
>>>
>>> Code: https://bpa.st/KVGA
>>>
>>> How this functions should look properly?
>>
>>
>> In the event of "yes" the function returns a value (return ask).
>> When the function calls itself, what happens to the return-ed value?

Apologies, the question was for you to ask yourself; not me asking for me!

When you read the code, to where are the results of the 'inner call' 
assigned?

If you can answer this question, you will solve 'the problem'!
(and have learned an approach to solving problems in-future)


> Well I've put the output in a paste as well, anyway here is what is in a
> paste:

Thank you.

Speaking personally, I prefer the code to be included in the email. 
However, it would be better to use spaces rather than tabs (Python's 
preferred style, per PEP-8) because many email packages implement 
tab-stops as eight-spaces apart.

-- 
Regards =dn


More information about the Python-list mailing list