



def 		_UpperCAmelCase    (				snake_case      ):





					"""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    (				snake_case      ):





					"""simple docstring"""

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


def 		_UpperCAmelCase    (				snake_case      ):





					"""simple docstring"""

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


if __name__ == "__main__":
	import doctest

	doctest.testmod()
	A__     				=	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.")








from urllib.error import HTTPError

from bsa import BeautifulSoup
from requests import exceptions, get

A__     				=	"""https://www.wellrx.com/prescriptions/{0}/{1}/?freshSearch=true"""


def 		_UpperCAmelCase    (				snake_case     ,						snake_case      ):





					"""simple docstring"""

					try:
										# Has user provided both inputs?
										if not drug_name or not zip_code:
															return None

										_lowerCAmelCase      =   BASE_URL.format(snake_case     ,						snake_case      )
										_lowerCAmelCase      =   get(snake_case      )

										# Is the response ok?
										response.raise_for_status()

										# Scrape the data using bs4
										_lowerCAmelCase      =   BeautifulSoup(response.text     ,						"""html.parser"""      )

										# This list will store the name and price.
										_lowerCAmelCase      =   []

										# Fetch all the grids that contains the items.
										_lowerCAmelCase      =   soup.find_all("""div"""     ,						{"""class""": """grid-x pharmCard"""}      )
										if grid_list and len(snake_case      ) > 0:
															for grid in grid_list:
																				# Get the pharmacy price.
																				_lowerCAmelCase      =   grid.find("""p"""     ,						{"""class""": """list-title"""}      ).text

																				# Get price of the drug.
																				_lowerCAmelCase      =   grid.find("""span"""     ,						{"""p""", """price price-large"""}      ).text

																				pharmacy_price_list.append(
																				    {
																				        """pharmacy_name""": pharmacy_name,
																				        """price""": price,
																				    }      )

										return pharmacy_price_list

					except (HTTPError, exceptions.RequestException, ValueError):
										return None


if __name__ == "__main__":
	# Enter a drug name and a zip code
	A__     				=	input("""Enter drug name: """).strip()
	A__     				=	input("""Enter zip code: """).strip()

	A__     				=	fetch_pharmacy_and_price_list(
	    drug_name, zip_code
	)

	if pharmacy_price_list:
		print(f"\nSearch results for {drug_name} at location {zip_code}:")
		for pharmacy_price in pharmacy_price_list:
			A__     				=	pharmacy_price["""pharmacy_name"""]
			A__     				=	pharmacy_price["""price"""]

			print(f"Pharmacy: {name} Price: {price}")
	else:
		print(f"No results found for {drug_name}")



