alex bwithtek alex bwithtek - 1 month ago 5
Python Question

How do i define something in python 2.7?

Im 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 im using to add in more questions and answers e.g 4th could be "sound"? thanks

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:")

Comments