



'''simple docstring'''



from __future__ import annotations

import math
from collections.abc import Callable



def   __lowerCAmelCase					(							lowerCamelCase   :						Callable[[int | float], int | float]				,		lowerCamelCase   :						int | float				,		lowerCamelCase   :						int | float				,		lowerCamelCase   :						int = 1_00				,		):






	'''simple docstring'''




	__lowerCAmelCase												=  x_start
	__lowerCAmelCase												=  fnc(lowerCamelCase					)
	__lowerCAmelCase												=  0.0

	for _ in range(lowerCamelCase					):
		# Approximates curve as a sequence of linear lines and sums their length
		__lowerCAmelCase												=  (x_end - x_start) / steps + xa
		__lowerCAmelCase												=  fnc(lowerCamelCase					)
		length += math.hypot(xa - xa				,		fxa - fxa					)

		# Increment step
		__lowerCAmelCase												=  xa
		__lowerCAmelCase												=  fxa

	return length


if __name__ == "__main__":



						def   __lowerCAmelCase					(							lowerCamelCase   :						Any					):






							'''simple docstring'''




							return math.sin(10 * x					)

						print('''f(x) = sin(10 * x)''')
						print('''The length of the curve from x = -10 to x = 10 is:''')
						lowerCAmelCase	:		Tuple				=   1_0
						while i <= 1_0_0_0_0_0:
												print(f'With {i} steps: {line_length(f, -1_0, 1_0, i)}')
												i *= 1_0




'''simple docstring'''



from __future__ import annotations



def   __lowerCAmelCase					(							lowerCamelCase   :						list					):






	'''simple docstring'''




	if not nums:
		raise ValueError("List is empty"					)
	return sum(lowerCamelCase					) / len(lowerCamelCase					)


if __name__ == "__main__":
	import doctest

	doctest.testmod()