Advertisement
EXTREMEXPLOIT

IP Calculator

May 22nd, 2019
282
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.60 KB | None | 0 0
  1. class IP:
  2.     def __init__(self, Data):
  3.         self.Data = []
  4.         for n in Data:
  5.             self.Data.append(int(n))
  6.            
  7.     def Add(self, N):
  8.         N = N-1
  9.         self.Data[3] += N
  10.         return str(self)
  11.    
  12.     def __str__(self):
  13.         IP = self.Data
  14.         String = str(IP[0]) + str(".") + str(IP[1]) + str(".") + str(IP[2]) + str(".") + str(IP[3])
  15.         return String
  16.  
  17. MainIP = input("IP:")
  18. MainIP = MainIP.split(".")
  19. MyIP = IP(MainIP)
  20.  
  21.  
  22. for n in range (7):
  23.     Range = str(MyIP) + str(" - ") + str(MyIP.Add(32))
  24.     MyIP.Add(2)
  25.     print(Range)
  26.     print("\n")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement