I have two lists:
host_list = ["10.3.11.250", "10.3.24.45", "10.5.3.5","10.3.4.5"]
ip_value = ["34.45.34.5", "10.3.11.250","10.3.4.5"]
I want to check whether the data of host_list is present in ip_value or not if it is then append the ip_value to another list. I am doing in this way check the following code:
for host,ip in zip(host_list ,ip_value):
if host_list == ip_value
list_ip = list_ip.append(ip)
But it does nothing.Why? and what should list_ip returns it will returns: {"10.3.11.250", "10.3.4.5"}
.ipv4or.ipv6attribute.{}). Someone edited it to lists (enclosed in[]).