
"""simple docstring"""


from __future__ import annotations

from collections.abc import Iterator
from typing import Generic, TypeVar

lowerCAmelCase								=						TypeVar("""T""")

class     A_	(     Generic[T]   ):



							"""simple docstring"""






							def __init__(  self  :List[str]     ,							lowerCamelCase_  :T       ):





										"""simple docstring"""

										lowerCamelCase__	:     Tuple              =data
										lowerCamelCase__	:     str              =None





							def __str__(  self  :str       ):





										"""simple docstring"""

										return f"""{self.data}"""






class     A_	(     Generic[T]   ):



							"""simple docstring"""






							def __init__(  self  :Optional[Any]       ):





										"""simple docstring"""

										lowerCamelCase__	:     int              =None





							def __iter__(  self  :List[str]       ):





										"""simple docstring"""

										lowerCamelCase__	:     Any              =self.top
										while node:
													yield node.data
													lowerCamelCase__	:     Optional[Any]              =node.next





							def __str__(  self  :str       ):





										"""simple docstring"""

										return "->".join([str(A_       ) for item in self]       )





							def __len__(  self  :int       ):





										"""simple docstring"""

										return len(tuple(iter(self       )       )       )





							def       UpperCAmelCase__							(  self  :Tuple       ):





										"""simple docstring"""

										return self.top is None





							def       UpperCAmelCase__							(  self  :Optional[Any]     ,							lowerCamelCase_  :T       ):





										"""simple docstring"""

										lowerCamelCase__	:     Tuple              =Node(A_       )
										if not self.is_empty():
													lowerCamelCase__	:     List[str]              =self.top
										lowerCamelCase__	:     List[Any]              =node





							def       UpperCAmelCase__							(  self  :Dict       ):





										"""simple docstring"""

										if self.is_empty():
													raise IndexError('pop from empty stack'       )
										assert isinstance(self.top     ,							A_       )
										lowerCamelCase__	:     List[Any]              =self.top
										lowerCamelCase__	:     List[str]              =self.top.next
										return pop_node.data





							def       UpperCAmelCase__							(  self  :Union[str, Any]       ):





										"""simple docstring"""

										if self.is_empty():
													raise IndexError('peek from empty stack'       )

										assert self.top is not None
										return self.top.data





							def       UpperCAmelCase__							(  self  :int       ):





										"""simple docstring"""

										lowerCamelCase__	:     Dict              =None


if __name__ == "__main__":
							from doctest import testmod

							testmod()





def 			_SCREAMING_SNAKE_CASE			(							lowercase	:       float	,							lowercase	:       list[float]     ):


      '''simple docstring'''



      if discount_rate < 0:
            raise ValueError('Discount rate cannot be negative'     )
      if not cash_flows:
            raise ValueError('Cash flows list cannot be empty'     )
      lowerCamelCase_		     =    sum(
          cash_flow / ((1 + discount_rate) ** i) for i, cash_flow in enumerate(lowercase     )     )
      return round(lowercase	,							ndigits=2     )


if __name__ == "__main__":
 import doctest

 doctest.testmod()



