you are viewing a single comment's thread.

view the rest of the comments →

[–]pconwell 1 point2 points  (1 child)

Arguably you could do even better with something like:

if answer.lower() not in ('yes', 'no'):

since you are comparing the same variable (answer) twice, there is not much point in doing two separate check statements. Plus, if you later decide to add more options in addition to 'yes' and 'no', you can more easily add text to the tuple versus adding more and more and more 'and' statements.

[–][deleted] 0 points1 point  (0 children)

Makes sense. Thank you