I have this code:
methods = ["SNMP", "SUDP","ESSYN", "SSYN", "HTTP"]
print("Methods: {}".format(', '.join(methods)))
method = input("Enter method: ")
method = method.upper()
while method != methods:
print("ERROR: Method unknown")
method = input("Enter method: ")
method = method.upper()
if method in methods:
print("Method: {}".format(method))
print(""
""
"")
seconds = input("Enter length in seconds: ")
print("{} seconds".format(seconds))
as you can see I'm trying to get an answer from the user then show the answer and go on to the next task. But if the answer is not on the list of methods, I want it to ask the question again. But I can't figure out how. The code that I use now is giving me the error message "ERROR: Method unknown" and when it finally does say: Method (with the method here) it won't go to the next task. Can anyone tell me what to do or what's wrong in this code?