Python Complement Operator

Python Program to illustrate complement operator

Try your Solution

Strongly recommended to Solve it on your own, Don't directly go to the solution given below.

#write your code here

Program or Solution

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

			
				
			

Program Explanation

1 complement = 0 0 complement = 1

Comments