def get_addresses_iterative(result_address):
    """Iterative generating possible addresses, replacing X with both
    0 and 1."""
    addresses = ['']
    for char in result_address:
        add = []
        if char != 'X':
            add.append(char)
        else:
            add.append('0')
            add.append('1')
        new_addresses = []
        for new_char in add:
            for address in addresses:
                new_addresses.append(address + new_char)
        addresses = new_addresses
    return addresses