Decode School

Decode School - The School for Problem Solvers
Welcome to My Blog.
Need Assignment / Project Guidance (or) Training in Python?

Python Xor

Python program to Illustrate xor operator (A xor A ==> 0)

Sample Input 1:

6

Sample Output 1:

0

Sample Input 2:

28

Sample Output 2:

0

Program or Solution

					    
							
num=int(input("enter the number:"))
num=num^num
print("num value is :{}".format(num));

					    
					

Program Explanation

XOR any value with the same produces zero.