I am trying to create a troubleshooting program for phones and tablets. I try to allow user inputs to call a list object, but when I enter an input, an error states that the list is not callable.
This is part of my code:
Phone = ["P", "Phone", "p", "phone", "fone", "Fone", "PHONE"] Tablet = ['T', 'Tab', 'Tablet', 't', 'tablet', 'TABLET', 'tab'] sol_1 = ("Hold the power button until the device vibrates and/or the screen is on.") def question(): mobile = raw_input('What mobile device are you using that has a problem? A phone or a tablet?\t') while mobile not in Phone() or Tablet(): print(sol_1) else: mobile = None mobile = raw_input("Please enter 'P' or 'T'\t") question()
This is the error I get when I call a list:
Traceback (most recent call last):
while mobile not in Phone() or Tablet():
TypeError: 'list' object is not callable
I want to keep the while loop input validation, but I don't know how to fix it. Can anyone help me please?