This is my code and the problem I am having is that it is not sequencing from the IF statements to the ELIF is there any way to fix this? Basically it works without the "or" part but it doesn't when you add the or to it. This is different to the other question as it is using strings whereas the other question uses integers.
import time
print "Welcome to the Troubleshooting Program"
time.sleep(0.2)
query=raw_input("What is your query? ")
querystr=str(query)
if "screen" or "Screen" in querystr:
in_file=open("Screen.txt", "r")
screen_answer=in_file.read()
print "We have identified the keyword Screen, here are your possible solutions:"
time.sleep(0.5)
print screen_answer
elif "wet" or "Wet" or "water" or "Water" in querystr:
in_file2=open("Wet.txt", "r")
screen_answer=in_file.read()
print "We have identified that the device has been in contact with water, here are your possible solutions:"
time.sleep(0.5)
print screen_answer
elif "Bath" or "bath" or "sink" or "Sink" or "toilet" or "Toilet" in querystr:
in_file3=open("Wet.txt", "r")
screen_answer=in_file.read()
print "We have identified that the device has been in contact with water, here are your possible solutions:"
time.sleep(0.5)
print screen_answer
elif "battery" or "Batttery" or "charge" in querystr:
in_file=open("Battery.txt", "r")
screen_answer=in_file.read()
print "We have identified that there is an issue with the devices battery, here are your possible solutions:"
time.sleep(0.5)
print screen_answer
elif "speaker" or "Speaker" or "Sound" or "sound" in querystr:
in_file=open("Speaker.txt", "r")
screen_answer=in_file.read()
print "We have identified that there is an issue with the devices speakers, here are your possible solutions:"
time.sleep(0.5)
print screen_answer
elif "port" or "Port" in querystr:
in_file=open("Port.txt", "r")
screen_answer=in_file.read()
print "We have identified that there is an issue with the devices ports, here are your possible solutions:"
time.sleep(0.5)
print screen_answer
else:
repeat=raw_input("Do you have another query? Y/N")
if repeat =="Y" or "y":
queryloop()
else:
print "Thank you!"
Thank you for your time.