'If statement calling both functions [duplicate]

I am trying to call a python function inside of an if when you input a certain letter. Even if the letter is not meant to be noticed by the if statement it calls both functions.

if printWrite == 'p' or 'P':
    printNum()
if printWrite == 'w' or 'W':
    writeNum()

Always calls both functions.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source