

def       snake_case__    (       lowerCAmelCase_      ):





     """simple docstring"""







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

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

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







def       snake_case__    (       lowerCAmelCase_      ):





     """simple docstring"""







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







def       snake_case__    (       lowerCAmelCase_      ):





     """simple docstring"""







     if str(lowerCAmelCase_      ).isalpha():
          SCREAMING_SNAKE_CASE										=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()
 _lowerCamelCase								=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.')




def       snake_case__    (       lowerCAmelCase_,   lowerCAmelCase_,   lowerCAmelCase_      ):





     """simple docstring"""







     if power < 0:
          return -1
     base %= mod
     SCREAMING_SNAKE_CASE										=1

     while power > 0:
          if power & 1:
               SCREAMING_SNAKE_CASE										=(result * base) % mod
          SCREAMING_SNAKE_CASE										=power >> 1
          SCREAMING_SNAKE_CASE										=(base * base) % mod

     return result







def       snake_case__    (       ):





     """simple docstring"""







     print(modular_exponential(3,   200,   13      )      )


if __name__ == "__main__":
 import doctest

 doctest.testmod()

 main()

