On 2020-12-17, Michael Torrie <[email protected]> wrote:
> On 12/17/20 9:10 AM, Bischoop wrote:
>> Could you expand here, I rather don't know how I could do it different
>> way apart from if maritals == 'Yes' or maritals == 'No' or is it what
>> you meant?
>
> I think he's hinting at using a loop instead.
>
> while maritals != 'Yes' and maritals != 'No':
> maritals = input('Married: Yes/No ?: ').title()
>
> I think I got the logical condition right. Sometimes those are tricky!
I think you're right.
Yes those are tricky sometimes :-)
Look how I had it previously:
def marriage():
maritals = input('Married: Yes/No ?: ').title()
while maritals != 'Yes' and maritals != 'No':
return marriage()
return maritals
marital = marriage()
When looking at it now I couldn't find the dumbest way for it.
--
https://mail.python.org/mailman/listinfo/python-list