


"""simple docstring"""


from __future__ import annotations

import math



def 	snake_case    (					_a:  int				)->		bool:
      '''simple docstring'''


      if 1 < number < 4:
            # 2 and 3 are primes
            return True
      elif number < 2 or number % 2 == 0 or number % 3 == 0:
            # Negatives, 0, 1, all even numbers, all multiples of 3 are not primes
            return False

      # All primes number are in format of 6k +/- 1
      for i in range(5		, int(math.sqrt(_A				) + 1				)		, 6				):
            if number % i == 0 or number % (i + 2) == 0:
                  return False
      return True



def 	snake_case    (					_a:  Union[str, Any]				)->		list[int]:
      '''simple docstring'''


      lowerCamelCase__							     =		str(_A				)
      lowerCamelCase__							     =		[n]
      for i in range(1		, len(_A				)				):
            list_nums.append(int(str_num[i:]				)				)
            list_nums.append(int(str_num[:-i]				)				)
      return list_nums



def 	snake_case    (					_a:  int				)->		bool:
      '''simple docstring'''


      if len(str(_A				)				) > 3:
            if not is_prime(int(str(_A				)[-3:]				)				) or not is_prime(int(str(_A				)[:3]				)				):
                  return False
      return True



def 	snake_case    (					_a:  Optional[int] = 11				)->		list[int]:
      '''simple docstring'''


      lowerCamelCase__							     =		[]
      lowerCamelCase__							     =		13
      while len(_A				) != count:
            if validate(_A				):
                  lowerCamelCase__							     =		list_truncated_nums(_A				)
                  if all(is_prime(_A				) for i in list_nums				):
                        list_truncated_primes.append(_A				)
            num += 2
      return list_truncated_primes



def 	snake_case    (					)->		int:
      '''simple docstring'''


      return sum(compute_truncated_primes(11				)				)


if __name__ == "__main__":
   print(f"""{sum(compute_truncated_primes(11)) = }""")











"""simple docstring"""







from itertools import zip_longest

import requests
from bsa import BeautifulSoup
from pandas import DataFrame


def      UpperCamelCase       ( _A = "laptop" )     ->       DataFrame:
				lowercase    :      List[str]       = F"""https://www.amazon.in/laptop/s?k={product}"""
				lowercase    :      str       = {
				    """User-Agent""": """Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36
        (KHTML, like Gecko)Chrome/44.0.2403.157 Safari/537.36""",
				    """Accept-Language""": """en-US, en;q=0.5""",
				}
				lowercase    :      str       = BeautifulSoup(requests.get(_A  ,				headers=_A ).text )
				# Initialize a Pandas dataframe with the column titles
				lowercase    :      Optional[Any]       = DataFrame(
				    columns=[
				        """Product Title""",
				        """Product Link""",
				        """Current Price of the product""",
				        """Product Rating""",
				        """MRP of the product""",
				        """Discount""",
				    ] )
				# Loop through each entry and store them in the dataframe
				for item, _ in zip_longest(
				    soup.find_all(
				        """div"""  ,				attrs={"""class""": """s-result-item""", """data-component-type""": """s-search-result"""}  ,				)  ,				soup.find_all("""div"""  ,				attrs={"""class""": """a-row a-size-base a-color-base"""} )  ,				):
								try:
												lowercase    :      str       = item.ha.text
												lowercase    :      Tuple       = """https://www.amazon.in/""" + item.ha.a["""href"""]
												lowercase    :      Tuple       = item.find("""span"""  ,				attrs={"""class""": """a-offscreen"""} ).text
												try:
																lowercase    :      Any       = item.find("""span"""  ,				attrs={"""class""": """a-icon-alt"""} ).text
												except AttributeError:
																lowercase    :      Tuple       = """Not available"""
												try:
																lowercase    :      Any       = (
																    """₹"""
																    + item.find(
																        """span"""  ,				attrs={"""class""": """a-price a-text-price"""} ).text.split("""₹""" )[1]
																)
												except AttributeError:
																lowercase    :      Any       = """"""
												try:
																lowercase    :      List[str]       = float(
																    (
																        (
																            float(product_mrp.strip("""₹""" ).replace(""","""  ,				"""""" ) )
																            - float(product_price.strip("""₹""" ).replace(""","""  ,				"""""" ) )
																        )
																        / float(product_mrp.strip("""₹""" ).replace(""","""  ,				"""""" ) )
																    )
																    * 100 )
												except ValueError:
																lowercase    :      Tuple       = float("""nan""" )
								except AttributeError:
												pass
								lowercase    :      Union[str, Any]       = [
								    product_title,
								    product_link,
								    product_price,
								    product_rating,
								    product_mrp,
								    discount,
								]
				lowercase    :      Tuple       = """ """
				lowercase    :      List[str]       = """ """
				data_frame.index += 1
				return data_frame


if __name__ == "__main__":
				_lowerCAmelCase            =	'headphones'
				get_amazon_product_data(product).to_csv(F'Amazon Product Data for {product}.csv')
