



'''simple docstring'''




def  __lowerCamelCase    (   _lowercase						) ->     bool:
							if not isinstance(_lowercase      ,							_lowercase						):
														raise ValueError("""Input series is not valid, valid series - [2, 4, 8]"""						)
							if len(_lowercase						) == 0:
														raise ValueError("""Input list must be a non empty list"""						)
							if len(_lowercase						) == 1:
														return True
							try:
														UpperCAmelCase	:						Optional[Any]					=						series[1] / series[0]
														for index in range(len(_lowercase						) - 1						):
																					if series[index + 1] / series[index] != common_ratio:
																												return False
							except ZeroDivisionError:
														return False
							return True



def  __lowerCamelCase    (   _lowercase						) ->     float:
							if not isinstance(_lowercase      ,							_lowercase						):
														raise ValueError("""Input series is not valid, valid series - [2, 4, 8]"""						)
							if len(_lowercase						) == 0:
														raise ValueError("""Input list must be a non empty list"""						)
							UpperCAmelCase	:						Optional[Any]					=						1
							for value in series:
														answer *= value
							return pow(_lowercase      ,							1 / len(_lowercase						)						)


if __name__ == "__main__":
							import doctest

							doctest.testmod()






'''simple docstring'''




class      UpperCamelCase_					:





	def __init__(    self       )     ->     None:
								UpperCAmelCase	:						int					=						[0, 1]






	def 					_lowercase(    self						,						A       )     ->     list:
								if (difference := index - (len(self.sequence       ) - 2)) >= 1:
															for _ in range(A       ):
																						self.sequence.append(self.sequence[-1] + self.sequence[-2]       )
								return self.sequence[:index]




def  __lowerCamelCase    (   ) ->     None:
							print(
							    """Fibonacci Series Using Dynamic Programming\n"""      ,							"""Enter the index of the Fibonacci number you want to calculate """      ,							"""in the prompt below. (To exit enter exit or Ctrl-C)\n"""      ,							sep=""""""      ,							)
							UpperCAmelCase	:						Tuple					=						Fibonacci()

							while True:
														UpperCAmelCase	:						str					=						input(""">> """						)
														if prompt in {"exit", "quit"}:
																					break

														try:
																					UpperCAmelCase	:						int					=						int(_lowercase						)
														except ValueError:
																					print("""Enter a number or 'exit'"""						)
																					continue

														print(fibonacci.get(_lowercase						)						)


if __name__ == "__main__":
							main()

