

def 			__UpperCamelCase    (lowerCAmelCase					:  int     )     ->  str:
      if not isinstance(lowerCAmelCase,    lowerCAmelCase     ):
            A    =				(
                'operation can not be conducted on a object of type '
                f'''{type(lowerCAmelCase     ).__name__}'''
            )
            raise TypeError(lowerCAmelCase     )
      A    =				''
      for _ in range(0,    32     ):
            bit_string += str(number % 2     )
            A    =				number >> 1
      return bit_string


def 			__UpperCamelCase    (lowerCAmelCase					:  int     )     ->  str:
      if number < 0:
            raise ValueError('the value of input must be positive'     )
      elif isinstance(lowerCAmelCase,    lowerCAmelCase     ):
            raise TypeError('Input value must be a \'int\' type'     )
      elif isinstance(lowerCAmelCase,    lowerCAmelCase     ):
            raise TypeError('\'<\' not supported between instances of \'str\' and \'int\''     )
      A    =				0
      # iterator over [1 to 32],since we are dealing with 32 bit integer
      for _ in range(1,    33     ):
            # left shift the bits by unity
            A    =				result << 1
            # get the end bit
            A    =				number % 2
            # right shift the bits by unity
            A    =				number >> 1
            # add that bit to our ans
            A    =				result | end_bit
      return get_reverse_bit_string(lowerCAmelCase     )


if __name__ == "__main__":
  import doctest

  doctest.testmod()






def 			__UpperCamelCase    (lowerCAmelCase					:  int     )     ->  int:
      barcode //= 10  # exclude the last digit
      A    =				False
      A    =				0

      # extract and check each digit
      while barcode != 0:
            A    =				1 if checker else 3
            s += mult * (barcode % 10)
            barcode //= 10
            A    =				not checker

      return (10 - (s % 10)) % 10


def 			__UpperCamelCase    (lowerCAmelCase					:  int     )     ->  bool:
      return len(str(lowerCAmelCase     )     ) == 13 and get_check_digit(lowerCAmelCase     ) == barcode % 10


def 			__UpperCamelCase    (lowerCAmelCase					:  str     )     ->  int:
      if str(lowerCAmelCase     ).isalpha():
            A    =				f'''Barcode \'{barcode}\' has alphabetic characters.'''
            raise ValueError(lowerCAmelCase     )
      elif int(lowerCAmelCase     ) < 0:
            raise ValueError('The entered barcode has a negative value. Try again.'     )
      else:
            return int(lowerCAmelCase     )


if __name__ == "__main__":
  import doctest

  doctest.testmod()
  _UpperCAmelCase    	=			get_barcode(input("Barcode: ").strip())

  if is_valid(barcode):
    print(F'''\'{barcode}\' is a valid barcode.''')
  else:
    print(F'''\'{barcode}\' is NOT a valid barcode.''')



