Python checking users input
Question: So, basically, this is my code:

    
    
    import random
    import os
    
    answer = input('What is the problem with your mobile phone? Please do not enter more than one sentence.')
    print('The program has detected that you have entered a query regarding: ' 
    if 'wet' or 'water' or 'liquid' or 'mobile' in answer:
        print('Put your mobile phone inside of a fridge, it sounds stupid but it should work!')
    

What I want to know is, say for example if the user enters the keywords 'wet'
and 'mobile' as their input, how do I feed back to them knowing that my
program has recognised their query.

So by saying something like 'The program has detected that you have entered a
query regarding:' how do I filter their keywords into this sentence, say, if
they entered 'My mobile phone has gotten wet recently', I want to pick out
'mobile' and 'wet' without saying:

    
    
    print('The program has detected that you have entered wet')
    

Because that sounds stupid IMO.

Thanks


Answer: If I understand your question correctly, this should solve your problem. Just
put the print statement inside the if condition! Very simple, I guess :)

    
    
    import random
    import os
    
    answer = input('What is the problem with your mobile phone? Please do not enter more than one sentence.')
    if 'wet' or 'water' or 'liquid' or 'mobile' in answer:
        print('The program has detected that you have entered a query regarding: water') # or anything else wet or whatever
        print('Put your mobile phone inside of a fridge, it sounds stupid but it should work!')
    

