


'''simple docstring'''

def __UpperCamelCase (      __lowerCamelCase		:			int					)   ->  int:







     '''simple docstring'''






     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:







     '''simple docstring'''






     return len(str(__lowerCamelCase					)					) == 13 and get_check_digit(__lowerCamelCase					) == barcode % 10






def __UpperCamelCase (      __lowerCamelCase		:			str					)   ->  int:







     '''simple docstring'''






     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()
   lowercase__					  =		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.''')





'''simple docstring'''

def __UpperCamelCase (      __lowerCamelCase		:			int					)   ->  int:







     '''simple docstring'''






     if not isinstance(__lowerCamelCase   ,	__lowerCamelCase					) or number < 0:
          raise ValueError("Input must be a non-negative integer"					)

     _a            =		number & ~(number - 1)
     _a            =		0
     while intermediate:
          intermediate >>= 1
          index += 1
     return index - 1


if __name__ == "__main__":
   import doctest

   doctest.testmod(verbose=True)

