fork download
  1. # your code goes here
  2. import ipaddress
  3. a = "1.0.3.0/31"
  4.  
  5. n = ipaddress.ip_network(unicode(a))
  6. b = ipaddress.ip_interface(unicode(a))
  7.  
  8. u = set(n.hosts()) - set([b.ip])
  9. u = [str(x) for x in u]
  10. print(", ".join(u))
  11.  
Success #stdin #stdout 0s 23704KB
stdin
Standard input is empty
stdout
1.0.3.1