






from __future__ import annotations






def 				A	(			a_   )	->		int | float:

					if len(a_   ) == 0:
										raise ValueError('find_max() arg is an empty sequence'   )
					__UpperCamelCase :   Optional[int]									=nums[0]
					for x in nums:
										if x > max_num:
															__UpperCamelCase :   str									=x
					return max_num


if __name__ == "__main__":
							import doctest

							doctest.testmod(verbose=True)



def  A			(   lowercase					)  ->    int:
		'''simple docstring'''

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

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

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


def  A			(   lowercase					)  ->    bool:
		'''simple docstring'''

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


def  A			(   lowercase					)  ->    int:
		'''simple docstring'''

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


if __name__ == "__main__":
					import doctest

					doctest.testmod()
					_UpperCAmelCase   :					List[str]    =			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.''')
