taking in subnet and ip address, performing a logical AND to retrieve the network address. My question is, how do I return a list of four octets, rather than just have all of the values stored into a list.
Example, my function is printing ['1','1','1','1'...], where as I want to print ['11111111','11111111','11111100','11111111']
def logicalAnd(ip, subnet):
test = list()
for ipOctect, subnetOctect in zip(ip, subnet):
for i,j in zip(ipOctect, subnetOctect):
octet = (i and j)
test.append(octet)
print(test)