Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ip_address = input('Введите IP-адреса в формате 10.0.1.1: ')
- ip_list = ip_address.split(".")
- oct1, oct2, oct3, oct4 = [
- int(ip_list[0]),
- int(ip_list[1]),
- int(ip_list[2]),
- int(ip_list[3]),
- ]
- if oct1 in range(1, 223):
- print('unicast')
- elif oct1 in range(224, 239):
- print('multicast')
- elif ip_address == '255.255.255.255':
- print('local broadcast')
- elif ip_address == '0.0.0.0':
- print('unassigned')
- else:
- print('unused')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement