input: Write a python function to convert a binary number to its decimal equivalent.
  assert binaryToDecimal(1010101) == 85
  assert binaryToDecimal(1111) == 15
  assert binaryToDecimal(100000) == 32
  assert binaryToDecimal(0) == 0
output: def binaryToDecimal(binary):
      decimal = 0
      binary_str = str(binary)
      length = len(binary_str)
      
      for i in range(length):
          decimal += int(binary_str[i]) * (2 ** (length - i - 1))
          
      return decimal