fork download
  1. from ipaddress import *
  2. net = ( '112.160.0.0 / 255.240.0.0' , 0)
  3. n = 0
  4. for ip in net:
  5. ip_bin = bin (int(ip)) [2:]
  6. if ip_bin.count('1') % 3 != 0:
  7. n += 1
  8. print (n)
Success #stdin #stdout 0.02s 25884KB
stdin
Standard input is empty
stdout
from ipaddress import *
net = ( '112.160.0.0 / 255.240.0.0' , 0)
n = 0 
for ip in net:
    ip_bin = bin (int(ip)) [2:]
    if ip_bin.count('1') % 3 != 0:
        n += 1
print (n)