alex bwithtek alex bwithtek - 1 month ago 10
Python Question

How to define something?

I'm trying to make a troubleshooting system however it comes up with an error saying issue is not defined. How do I correct this? Also could I continue with the array I'm using to add in more questions and answers e.g 4th could be

sound
?

def troubleshooting():
print("Welcome to my phone troubleshooting system...")

problem = raw_input("Type the problem with the phone:")

problem = ['cracked', 'crack', 'broken']

if problem[0] in issue:
print("Replace screen")
elif problem[1] in issue:
print("Replace screen")
elif problem[2] in issue:
print("Replace phone")
else:
print("Replace screen")

Answer

issue is not defined because you made a little mistake you put what the user typed inside problem instead of issue with that line : problem = raw_input("Type the problem with the phone:")