





"""simple docstring"""


from urllib.error import HTTPError

from bsa import BeautifulSoup
from requests import exceptions, get

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





def 							a__	(     _UpperCAmelCase		,   _UpperCAmelCase		)			->     list | None:

 '''simple docstring'''






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

  snake_case__										= BASE_URL.format(_UpperCAmelCase		,   _UpperCAmelCase		)
  snake_case__										= get(_UpperCAmelCase		)

  # Is the response ok?
  response.raise_for_status()

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

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

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

    # Get price of the drug.
    snake_case__										= 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__    :   Optional[int]    						= input("""Enter drug name: """).strip()
   a__    :   Union[str, Any]    						= input("""Enter zip code: """).strip()

   a__    :   list | None    						= 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__    :   Tuple    						= pharmacy_price["""pharmacy_name"""]
         a__    :   Any    						= pharmacy_price["""price"""]

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








"""simple docstring"""


from __future__ import annotations





def 							a__	(     _UpperCAmelCase		,   _UpperCAmelCase		,   _UpperCAmelCase		,   )			->     list[float | int]:

 '''simple docstring'''






 if not all((nth_term, start_term_a, common_ratio_r)		):
  return []
 snake_case__										= []
 snake_case__										= 1
 snake_case__										= common_ratio_r
 for _ in range(int(_UpperCAmelCase		)		):
  if not series:
   series.append(_UpperCAmelCase		)
  else:
   power += 1
   series.append(float(start_term_a * multiple		)		)
   snake_case__										= pow(float(_UpperCAmelCase		)		,   _UpperCAmelCase		)
 return series


if __name__ == "__main__":
   import doctest

   doctest.testmod()

   a__    :   int    						= float(input("""Enter the last number (n term) of the Geometric Series"""))
   a__    :   str    						= float(input("""Enter the starting term (a) of the Geometric Series"""))
   a__    :   str    						= float(
       input("""Enter the common ratio between two terms (r) of the Geometric Series""")
   )
   print("""Formula of Geometric Series => a + ar + ar^2 ... +ar^n""")
   print(geometric_series(nth_term, start_term_a, common_ratio_r))

