Decode School

Python Complement Operator

Python Program to illustrate complement operator

Program or Solution

					    
							
num=int(input("Enter your Number:"))
print("After Complement: {}".format(~num))

					    
					

Program Explanation

1 complement = 0 0 complement = 1