def binary_to_decimal(number):
    """
        This function calculates the decimal of the given binary number
        :param number: decimal number in string or integer format
        :return : integer of the equivalent decimal number

        Algo:
        1. Get the last digit of the binary number.
        2. Multiply the current digit with (2^power), store the result.
        3. Increment power by 1.
        4. Repeat from step 2 until all digits have been multiplied.
        5. Sum the result of step 2 to get the answer number.
    """
    decimal = []
    number = list(str(number)[::-1])
    for i in range(len(number)):
        decimal.append(int(number[i]) * 2 ** i)
    return sum(decimal)
