code: def host_last(self):
          
          if (self.version() == 4 and self.mask == 32) or \
                  (self.version() == 6 and self.mask == 128):
              return self
          elif (self.version() == 4 and self.mask == 31) or \
                  (self.version() == 6 and self.mask == 127):
              return IP(int(self) + 1, version=self.version())
          else:
              return IP(self.broadcast_long() - 1, version=self.version())
docs: Last available host in this subnet.