input: Write a python function to convert a binary number to its decimal equivalent.
  assert BinaryToDecimal(101010) == 42
  assert BinaryToDecimal(1111) == 15
  assert BinaryToDecimal(100000) == 32
output: def BinaryToDecimal(binary):
      decimal = 0
      binary_str = str(binary)
      for i, digit in enumerate(binary_str[::-1]):
          decimal += int(digit) * (2 ** i)
      return decimal