




def      UpperCAmelCase  (						UpperCamelCase__   )     ->     int:







				'''simple docstring'''


				if not isinstance(UpperCamelCase__						,			UpperCamelCase__   ):
								raise ValueError("""double_factorial() only accepts integral values"""   )
				if n < 0:
								raise ValueError("""double_factorial() not defined for negative values"""   )
				return 1 if n <= 1 else n * double_factorial(n - 2   )


if __name__ == "__main__":
	import doctest

	doctest.testmod()











def      UpperCAmelCase  (						UpperCamelCase__   )     ->     int:







				'''simple docstring'''


				barcode //= 10  # exclude the last digit
				__lowerCAmelCase					=  False
				__lowerCAmelCase					=  0

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

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





def      UpperCAmelCase  (						UpperCamelCase__   )     ->     bool:







				'''simple docstring'''


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





def      UpperCAmelCase  (						UpperCamelCase__   )     ->     int:







				'''simple docstring'''


				if str(UpperCamelCase__   ).isalpha():
								__lowerCAmelCase					=  F'''Barcode \'{barcode}\' has alphabetic characters.'''
								raise ValueError(UpperCamelCase__   )
				elif int(UpperCamelCase__   ) < 0:
								raise ValueError("""The entered barcode has a negative value. Try again."""   )
				else:
								return int(UpperCamelCase__   )


if __name__ == "__main__":
	import doctest

	doctest.testmod()
	__A						:		Tuple          =						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.""")





