






'''simple docstring'''







def       __UpperCamelCase					(      lowercase_       :  list   ):
       """simple docstring"""




       if not isinstance(lowercase_   ,       lowercase_   ):
              raise ValueError('Input series is not valid, valid series - [2, 4, 6]'   )
       if len(lowercase_   ) == 0:
              raise ValueError('Input list must be a non empty list'   )
       if len(lowercase_   ) == 1:
              return True
       a_						     =			series[1] - series[0]
       for index in range(len(lowercase_   ) - 1   ):
              if series[index + 1] - series[index] != common_diff:
                     return False
       return True


def       __UpperCamelCase					(      lowercase_       :  list   ):
       """simple docstring"""




       if not isinstance(lowercase_   ,       lowercase_   ):
              raise ValueError('Input series is not valid, valid series - [2, 4, 6]'   )
       if len(lowercase_   ) == 0:
              raise ValueError('Input list must be a non empty list'   )
       a_						     =			0
       for val in series:
              answer += val
       return answer / len(lowercase_   )


if __name__ == "__main__":
  import doctest

  doctest.testmod()












'''simple docstring'''







from __future__ import annotations

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

__lowerCAmelCase        =							TypeVar("T")




class   __SCREAMING_SNAKE_CASE       (Generic[T]       ):


  """simple docstring"""


  def __init__(			self   ,	UpperCamelCase__	):






         """simple docstring"""


         a_						     =			data
         a_						     =			None







  def __str__(			self	):






         """simple docstring"""


         return f'{self.data}'





class   __SCREAMING_SNAKE_CASE       (Generic[T]       ):


  """simple docstring"""


  def __init__(			self	):






         """simple docstring"""


         a_						     =			None







  def __iter__(			self	):






         """simple docstring"""


         a_						     =			self.top
         while node:
                yield node.data
                a_						     =			node.next







  def __str__(			self	):






         """simple docstring"""


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







  def __len__(			self	):






         """simple docstring"""


         return len(tuple(iter(self	)	)	)







  def    _a       (			self	):






         """simple docstring"""


         return self.top is None







  def    _a       (			self   ,	UpperCamelCase__	):






         """simple docstring"""


         a_						     =			Node(UpperCamelCase__	)
         if not self.is_empty():
                a_						     =			self.top
         a_						     =			node







  def    _a       (			self	):






         """simple docstring"""


         if self.is_empty():
                raise IndexError('pop from empty stack'	)
         assert isinstance(self.top   ,	UpperCamelCase__	)
         a_						     =			self.top
         a_						     =			self.top.next
         return pop_node.data







  def    _a       (			self	):






         """simple docstring"""


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

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







  def    _a       (			self	):






         """simple docstring"""


         a_						     =			None


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

  testmod()




