input: Write a function to convert a positive integer to negative or vice versa using bitwise NOT operator. The function should have two parts: one for converting positive integers to negative and another for converting negative integers to positive. If the input is 0, the function should return 0.
  def convert_to_negative(x): 
      if x == 0: return 0
      return ~x + 1
    
  def convert_to_positive(x): 
      if x == 0: return 0
      return ~(x-1)
  
  assert convert_to_negative(5)==-5
  assert convert_to_negative(-3)==-3
  assert convert_to_negative(0)==0
  
  assert convert_to_positive(-5)==5
  assert convert_to_positive(3)==3
  assert convert_to_positive(0)==0
output: def convert_to_negative(x): 
      if x == 0: return 0
      return ~x + 1
    
  def convert_to_positive(x): 
      if x == 0: return 0
      return ~(x-1)