fiftyfizzbuzzes icon indicating copy to clipboard operation
fiftyfizzbuzzes copied to clipboard

Fixed 'y' or 'yes' comparisons

Open DominoPivot opened this issue 6 years ago • 0 comments

While Python supports range comparisons like a < b < c, it doesn't do anything special with the == operator, so in the comparison ask == ("y" or "yes"), the or evaluates first which results in ask == "y".

A simple fix is to use the in operator with a tuple: ask in ("y", "yes"). And hey, finally an occasion for me to test making a pull request on someone else's github :)

DominoPivot avatar Oct 31 '18 18:10 DominoPivot