



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        __a     (    lowerCAmelCase_   :					str			,lowerCAmelCase_   :					str				)      -> list | None:






						'''simple docstring'''



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

												UpperCAmelCase_=   BASE_URL.format(lowerCAmelCase_			,lowerCAmelCase_				)
												UpperCAmelCase_=   get(lowerCAmelCase_				)

												# Is the response ok?
												response.raise_for_status()

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

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

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

																								# Get price of the drug.
																								UpperCAmelCase_=   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}')









def        __a     (    lowerCAmelCase_   :					int				)      -> int:






						'''simple docstring'''



						if number != int(lowerCAmelCase_				):
												raise ValueError("""factorial() only accepts integral values"""				)
						if number < 0:
												raise ValueError("""factorial() not defined for negative values"""				)
						UpperCAmelCase_=   1
						for i in range(1			,number + 1				):
												value *= i
						return value



def        __a     (    lowerCAmelCase_   :					int				)      -> int:






						'''simple docstring'''



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


if __name__ == "__main__":
	import doctest

	doctest.testmod()

	__A				    =						int(input('''Enter a positive integer: ''').strip() or 0)
	print(f'factorial{n} is {factorial(n)}')




