


from __future__ import annotations

from typing import Generic, TypeVar

UpperCAmelCase			=    TypeVar("""T""")







class lowerCAmelCase_						( lowerCamelCase__       ):

 '''simple docstring'''

 pass







class lowerCAmelCase_						( lowerCamelCase__       ):

 '''simple docstring'''

 pass







class lowerCAmelCase_						( Generic[T]       ):

 '''simple docstring'''

 def __init__(	self		,      _UpperCAmelCase = 10					):
       snake_case_       =      []
       snake_case_       =      limit



 def __bool__(	self					):
       return bool(self.stack					)



 def __str__(	self					):
       return str(self.stack					)



 def 						UpperCamelCase__     (	self		,      _UpperCAmelCase					):
       if len(self.stack					) >= self.limit:
             raise StackOverflowError
       self.stack.append(_UpperCAmelCase					)



 def 						UpperCamelCase__     (	self					):
       if not self.stack:
             raise StackUnderflowError
       return self.stack.pop()



 def 						UpperCamelCase__     (	self					):
       if not self.stack:
             raise StackUnderflowError
       return self.stack[-1]



 def 						UpperCamelCase__     (	self					):
       return not bool(self.stack					)



 def 						UpperCamelCase__     (	self					):
       return self.size() == self.limit



 def 						UpperCamelCase__     (	self					):
       return len(self.stack					)





 def __contains__(	self		,      _UpperCAmelCase					):
       return item in self.stack






def        __lowerCAmelCase    ()->  None:




      """simple docstring"""

      snake_case_       =      Stack(10					)
      assert bool(SCREAMING_SNAKE_CASE					) is False
      assert stack.is_empty() is True
      assert stack.is_full() is False
      assert str(SCREAMING_SNAKE_CASE					) == "[]"

      try:
            snake_case_       =      stack.pop()
            raise AssertionError  # This should not happen
      except StackUnderflowError:
            assert True  # This should happen

      try:
            snake_case_       =      stack.peek()
            raise AssertionError  # This should not happen
      except StackUnderflowError:
            assert True  # This should happen

      for i in range(10					):
            assert stack.size() == i
            stack.push(SCREAMING_SNAKE_CASE					)

      assert bool(SCREAMING_SNAKE_CASE					)
      assert not stack.is_empty()
      assert stack.is_full()
      assert str(SCREAMING_SNAKE_CASE					) == str(list(range(10					)					)					)
      assert stack.pop() == 9
      assert stack.peek() == 8

      stack.push(100					)
      assert str(SCREAMING_SNAKE_CASE					) == str([0, 1, 2, 3, 4, 5, 6, 7, 8, 100]					)

      try:
            stack.push(200					)
            raise AssertionError  # This should not happen
      except StackOverflowError:
            assert True  # This should happen

      assert not stack.is_empty()
      assert stack.size() == 10

      assert 5 in stack
      assert 55 not in stack


if __name__ == "__main__":
   test_stack()



def        __lowerCAmelCase    (SCREAMING_SNAKE_CASE					)->  int:




      """simple docstring"""

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






def        __lowerCAmelCase    (SCREAMING_SNAKE_CASE					)->  int:




      """simple docstring"""

      if not isinstance(SCREAMING_SNAKE_CASE					,					SCREAMING_SNAKE_CASE					):
            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()

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