def binary_to_decimal(binary):
    """Converts a binary number(str) into a decimal(int)"""
    reversed_binary = binary[::- 1]
    # i = corresponds to power of 2 when reversed
    decimal = 0  # keep track of sum
    for i, value in enumerate(reversed_binary):
        if value == "0":
            continue  # ignore 0 because no value
        decimal += 2**i  # multiply 2 by i b/c i = exponent
    return decimal