Advertisement
Guest User

Untitled

a guest
Jan 29th, 2020
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. ip_address = input('Введите IP-адреса в формате 10.0.1.1: ')
  2. ip_list = ip_address.split(".")
  3. oct1, oct2, oct3, oct4 = [
  4. int(ip_list[0]),
  5. int(ip_list[1]),
  6. int(ip_list[2]),
  7. int(ip_list[3]),
  8. ]
  9.  
  10. if oct1 in range(1, 223):
  11. print('unicast')
  12. elif oct1 in range(224, 239):
  13. print('multicast')
  14. elif ip_address == '255.255.255.255':
  15. print('local broadcast')
  16. elif ip_address == '0.0.0.0':
  17. print('unassigned')
  18. else:
  19. print('unused')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement