I am fairly new to python programming, and recently I ran into this problem.
while(True):
panelType = input("Enter the type of panel[a, b, c, d]: ")
if(panelType.lower() != "a"
| panelType.lower() != "b"
| panelType.lower() != "c"
| panelType.lower() != "d"):
logger.error("Not a valid input. Try Again")
else:
break
When I use bitwise operator I get this error: unsupported operand type(s) for |: 'str' and 'str'
. However, once I changed it to OR operator, it worked well.
Could anyone explain why this occurred?
Thanks