In my class we are attempting to use python to loop simple programs and ask the user if they want to continue. Initially i devised this simple line:
answer = input("Do you want to continue? \n")
if "n" or "N" in answer:
cont = False
However it is treating any string of characters input into "answer" as though they contain "n" or "N". At the top of the program is "while cont:" which ensures the program loops otherwise. If i take out the user input it will loop indefinitely. With the user prompt written as it is it will always break.
Why does it behave like this? Is it possible to look over a string and return a particular response without having to enter a precise string?