






"""simple docstring"""



from __future__ import annotations

from typing import Generic, TypeVar

a  :						Optional[int]					       =							TypeVar('''T''')


class 	_UpperCamelCase ( Generic[T]							):



    '''simple docstring'''


    def __init__(      self   ,			__lowercase			):
     UpperCAmelCase__ 						=				data  # Assign data
     UpperCAmelCase__ 						=				None  # Initialize next as null
     UpperCAmelCase__ 						=				None  # Initialize prev as null



class 	_UpperCamelCase ( Generic[T]							):



    '''simple docstring'''


    def __init__(      self			):
     UpperCAmelCase__ 						=				None


    def 		A__      (      self   ,			__lowercase			):
     if self.head is None:
      UpperCAmelCase__ 						=				Node(__lowercase			)
     else:
      UpperCAmelCase__ 						=				Node(__lowercase			)
      UpperCAmelCase__ 						=				new_node
      UpperCAmelCase__ 						=				self.head
      UpperCAmelCase__ 						=				None
      UpperCAmelCase__ 						=				new_node


    def 		A__      (      self			):
     if self.head is None:
      return None
     else:
      assert self.head is not None
      UpperCAmelCase__ 						=				self.head.data
      UpperCAmelCase__ 						=				self.head.next
      if self.head is not None:
       UpperCAmelCase__ 						=				None
      return temp


    def 		A__      (      self			):
     return self.head.data if self.head is not None else None


    def __len__(      self			):
     UpperCAmelCase__ 						=				self.head
     UpperCAmelCase__ 						=				0
     while temp is not None:
      count += 1
      UpperCAmelCase__ 						=				temp.next
     return count


    def 		A__      (      self			):
     return self.head is None






    def 		A__      (      self			):
     print("""stack elements are:"""			)
     UpperCAmelCase__ 						=				self.head
     while temp is not None:
      print(temp.data   ,			end="""->"""			)
      UpperCAmelCase__ 						=				temp.next


# Code execution starts here
if __name__ == "__main__":
 # Start with the empty stack
 a  :						Stack[int]					       =							Stack()

 # Insert 4 at the beginning. So stack becomes 4->None
 print('''Stack operations using Doubly LinkedList''')
 stack.push(4)

 # Insert 5 at the beginning. So stack becomes 4->5->None
 stack.push(5)

 # Insert 6 at the beginning. So stack becomes 4->5->6->None
 stack.push(6)

 # Insert 7 at the beginning. So stack becomes 4->5->6->7->None
 stack.push(7)

 # Print the stack
 stack.print_stack()

 # Print the top element
 print('''\nTop element is ''', stack.top())

 # Print the stack size
 print('''Size of the stack is ''', len(stack))

 # pop the top element
 stack.pop()

 # pop the top element
 stack.pop()

 # two elements have now been popped off
 stack.print_stack()

 # Print True if the stack is empty else False
 print('''\nstack is empty:''', stack.is_empty())











"""simple docstring"""



from math import exp




def       snake_case__		(   _SCREAMING_SNAKE_CASE			)    ->float:
 return 8 * x - 2 * exp(-x			)




def       snake_case__		(   _SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE			)    ->float:
 UpperCAmelCase__ 						=				lower_bound
 UpperCAmelCase__ 						=				upper_bound
 for _ in range(0       ,	_SCREAMING_SNAKE_CASE			):
  UpperCAmelCase__						,	UpperCAmelCase__ 						=				xa, xa - (f(_SCREAMING_SNAKE_CASE			) * (xa - xa)) / (f(_SCREAMING_SNAKE_CASE			) - f(_SCREAMING_SNAKE_CASE			))
 return xa


if __name__ == "__main__":
 print(F'''Example: {secant_method(1, 3, 2)}''')



