
'''simple docstring'''





def   A			(							A_				:       int							):
						barcode //= 10  # exclude the last digit
						snake_case							:  Tuple			=     False
						snake_case							:  str			=     0

						# extract and check each digit
						while barcode != 0:
												snake_case							:  List[Any]			=     1 if checker else 3
												s += mult * (barcode % 10)
												barcode //= 10
												snake_case							:  Optional[int]			=     not checker

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

def   A			(							A_				:       int							):
						return len(str(A_							)							) == 13 and get_check_digit(A_							) == barcode % 10

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


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.''')



'''simple docstring'''







def 				_snake_case (		lowercase						)       ->       int:
				if not isinstance(lowercase			,    lowercase						):
								__a       :     Union[str, Any]								=	F"""Input value of [number={number}] must be an integer"""
								raise TypeError(lowercase						)
				if number < 1:
								raise ValueError("""Input must be a positive integer"""						)
				return number * (2 * number - 1)


if __name__ == "__main__":
					import doctest

					doctest.testmod()