Sorry for the poor explanation in the question, but here's my code:
import csv
file = open("problems_solutions.csv","a+")
name = input("What is your name?")
file.write(name+",")
problem = input("Enter the problem that you have with your mobile phone.").lower()
file.write(problem+"\n")
file.close()
Basically, it asks the user for their name and the problem that they have and writes it to a .csv; this part works perfectly.
if ["sound","speaker","volume","audio","earphone","earphones","headphones","headphone"] in problem.split():
file=open("nosound Solutions.txt","rb")
print(file.read())
file.close()
if ["battery","charge","charged","low"] in problem.split():
file = open("lowbattery Solutions.txt","r")
print(file.read())
file.close()
However, when the user inputs a problem such as "My sound isn't working", nothing happens after that - no output, nothing. I have tried taking out the square brackets and replacing the commas with ' or ', but since I have multiple of these if statements for different solutions, it instead prints every text document in the code.
The text documents contain the solutions, e.g. "Try restarting the phone.", "Check if it's on mute."
If any other information is required, then I'm more than happy to provide; this problem is frustrating me and I can't find how to fix it.
Thanks