code: def is_valid_ip_prefix(prefix, bits):
      
      try:
          # Prefix should be a number
          prefix = int(prefix)
      except ValueError:
          return False
  
      # Prefix should be a number between 0 to *bits*
      return 0 <= prefix <= bits
docs: Returns True if *prefix* is a valid IPv4 or IPv6 address prefix.
  
      *prefix* should be a number between 0 to *bits* length.