#try to avoid input function a = input("Enter any Binary Number :") b = "" for i in range(len(a)): if a[i] == "0": b = b+"1" else: b = b+"0" print("1's complement form is :"+b)
Click the run button. Try to avoid input() function.