Decode School

Decode School - The School for Problem Solvers

Welcome to my blog. Subscribe and get my latest blog post in your inbox.

Python Bitwise OR

Python Program to illustrate bitwise OR operator

Sample Input 1 :

1 4

Sample Output 2 :

5

Program or Solution

					    
							
num1=int(input("Enter your First Number:"))
num2=int(input("Enter your Second Number:"))
num=num1|num2
print("After Bit Wise Or: {}".format(num))

					    
					

Program Explanation

1 | anything = 1 0 | 0 = 0