Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from ipaddress import *
- answ = 1000000000000
- for mask in range(1, 21):
- net = ip_network('113.188.14.51/' + str(mask), 0)
- if ip_address('113.188.6.86') in net:
- cnt = 0
- for ip in net:
- if f'{ip:b}'.count('1') == 17:
- cnt += 1
- answ = min(answ, cnt)
- print(answ)
Advertisement
Add Comment
Please, Sign In to add comment