0

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.

John Kugelman
  • 330,190
  • 66
  • 504
  • 555
King Ferrum
  • 19
  • 1
  • 3
  • You need `if printWrite == ‘p’ or printWrite ==‘P’`. or doesn’t work like that. You can also try: `if printWrite in (‘p’, ‘P’):` – Max May 13 '22 at 17:34

0 Answers0