0

So I'm trying to make this code piece in which the user will be asked what is wrong with their device, and depending on their input, the code will identify 'keywords' in this string, and therefore print the advice that the user will need to help resolve their issue.

Here is my code thus far, but when I input a keyword I have put in the code so that the code can recognise it, the output is just all the 'advice' printed at once. Can anyone resolve this for me?

problem = raw_input("Hello. Welcome to the device help service. What is 
the problem with your device? ").lower()

if "cracked" or "crack" or "smash" or "smashed" in problem:
    print "(Resolution to damaged screen/cracked camera lens)"
elif "cracked" or "crack" or "smash" or "smashed" not in problem:
    None

if "dented" or "bent" or "snapped" in problem:
    print "(Resolution to damaged exterior)"
elif "dented" or "bent" or "snapped" not in problem:
    None

if "blurry" or "focus" or "picture" or "photo" in problem:
    print "(Resolution to damaged camera)"
elif "blurry" or "focus" or "picture" or "photo" not in problem:
    None

if "virus" or "hacked" or "glitch" or "popup" or "popups" in problem:
    print "(Resolution to infected device)"
elif "virus" or "hacked" or "glitch" or "popup" or "popups" not in problem:
    None

if "wet" or "water" or "moisture" in problem:
    print "(Resolution to wet device)"
elif "wet" or "water" or "moisture" not in problem:
    None

if "charged" or "power" or "turn" or "charger" or "battery" in problem:
    print "(Resolution to damaged battery/charging process)"
elif "charged" or "power" or "turn" or "charger" or "battery" not in         
problem:
    None

else:
    print "Sorry, we could not verify the issue your device has."

(Please answer in a way I will understand, please, bearing in mind I am a little stupid)

CodeNoob
  • 11
  • 2

0 Answers0