Article 4VH4N [SOLVED] [PYTHON] OR operator works like AND

[SOLVED] [PYTHON] OR operator works like AND

by
czezz
from LinuxQuestions.org on (#4VH4N)
Im having a problem with "OR" operator in "if" condition.
At the moment it works like AND.

quit() should be executed if any of the inputs is not numerical/intiger.
Meanwhile, it works ONLY if both inputs are non-numerical/intiger.

I tried to replace | with || and or. No success :(

Can anyone help me out here? What im doing wrong?

Code:#!/usr/bin/python3
import sys

a=input("one: ")
b=input("two: ")

if( a.isdigit() | b.isdigit() ):
print("User input is Number ")
else:
print("One of provided inputs is not a number")
quit()

print (a)
print (b)latest?d=yIl2AUoC8zA latest?i=02ZblUxHD1Y:jqPQ778yLsM:F7zBnMy latest?i=02ZblUxHD1Y:jqPQ778yLsM:V_sGLiP latest?d=qj6IDK7rITs latest?i=02ZblUxHD1Y:jqPQ778yLsM:gIN9vFw02ZblUxHD1Y
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments