For context, I am using:
Windows 10
Jupter Notebook 6.4.12
Python 3.8.13
Question
I am trying to understand why the 'if x in else' statement isn't working in my Jupyter Notebooks.
Here is the code I am trying to get to work… but the code keeps returning the statement, stipulating 'sunny' or 'lovely' have been found in the string. However, you can clearly see the string does not contain these words…
Here is the code:
Here is the response:
Incorrect response
So, instead of printing 'neither has been detected', it prints 'sunny or lovely have been detected' – which as you can see is wrong, given the if else statement conditions…
Any advice appreciated. Thanks in advance
View on Stack Overflow
