Mar-17-2018, 08:14 PM
So I'm having trouble with a chunk of code that is supposed to check multiple characters against a user input. The problem is, it will only work for the first character. If I try to add more options with the 'or' the whole thing basically stops working. This is how I remember 'or' working and I don't know why it won't run here.
res = str(input('What calculation would you like to do?[+] [-] [/] [*] [%] [^]: ')) if res != '+' or '-' or '/' or '^' or '*' or '%': print("please choose ", arr) res = str(input('Enter: '))Can anybody assist? It prints the next input request no matter what. I tried res != each individual char and that didn't help either. It works fine if it's only res != '+'