i'm using PyCharm, in such cases i have red underline and code would not run properly.
I replaced tabs with 4 spaces, but it did not help at all.
if answer == ("y" or "yes"):
display_lesson()
I have replaced "y" with "yes" so answer is True only for "y" because for "yes" it going to else statement.
It looks my IDE does not consider "or".
PS. i was fooling around and changed or to and. In that case for answer is True for "yes".
Anyhow ill back to version without parentheses, just was curious what is going on in background.
Piotr