






def 	_SCREAMING_SNAKE_CASE  (       __lowercase      :	int	, __lowercase      :	int = 1_0_0_0			)  ->					str:





    """simple docstring"""

    if (not isinstance(lowerCAmelCase_	, lowerCAmelCase_			)) or (digit_position <= 0):
        raise ValueError("""Digit position must be a positive integer"""			)
    elif (not isinstance(lowerCAmelCase_	, lowerCAmelCase_			)) or (precision < 0):
        raise ValueError("""Precision must be a nonnegative integer"""			)

    # compute an approximation of (16 ** (n - 1)) * pi whose fractional part is mostly
    # accurate
    __A   			=		(
        4 * _subsum(lowerCAmelCase_	, 1	, lowerCAmelCase_			)
        - 2 * _subsum(lowerCAmelCase_	, 4	, lowerCAmelCase_			)
        - _subsum(lowerCAmelCase_	, 5	, lowerCAmelCase_			)
        - _subsum(lowerCAmelCase_	, 6	, lowerCAmelCase_			)
    )

    # return the first hex digit of the fractional part of the result
    return hex(int((sum_result % 1) * 1_6			)			)[2:]



def 	_SCREAMING_SNAKE_CASE  (       __lowercase      :	int	, __lowercase      :	int	, __lowercase      :	int			)  ->					float:





    """simple docstring"""

    __A   			=		0.0
    for sum_index in range(digit_pos_to_extract + precision			):
        __A   			=		8 * sum_index + denominator_addend
        if sum_index < digit_pos_to_extract:
            # if the exponential term is an integer and we mod it by the denominator
            # before dividing, only the integer part of the sum will change;
            # the fractional part will not
            __A   			=		pow(
                1_6	, digit_pos_to_extract - 1 - sum_index	, lowerCAmelCase_			)
        else:
            __A   			=		pow(1_6	, digit_pos_to_extract - 1 - sum_index			)
        total += exponential_term / denominator
    return total


if __name__ == "__main__":
  import doctest

  doctest.testmod()









def        __a     (    lowerCAmelCase_   :					list				)      -> bool:






						'''simple docstring'''



						if not isinstance(lowerCAmelCase_			,lowerCAmelCase_				):
												raise ValueError("""Input series is not valid, valid series - [1, 2/3, 2]"""				)
						if len(lowerCAmelCase_				) == 0:
												raise ValueError("""Input list must be a non empty list"""				)
						if len(lowerCAmelCase_				) == 1 and series[0] != 0:
												return True
						UpperCAmelCase_=   []
						UpperCAmelCase_=   len(lowerCAmelCase_				)
						for i in range(0			,lowerCAmelCase_				):
												if series[i] == 0:
																		raise ValueError("""Input series cannot have 0 as an element"""				)
												rec_series.append(1 / series[i]				)
						UpperCAmelCase_=   rec_series[1] - rec_series[0]
						for index in range(2			,lowerCAmelCase_				):
												if rec_series[index] - rec_series[index - 1] != common_diff:
																		return False
						return True



def        __a     (    lowerCAmelCase_   :					list				)      -> float:






						'''simple docstring'''



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


if __name__ == "__main__":
	import doctest

	doctest.testmod()




