
"""simple docstring"""






from __future__ import annotations

from collections.abc import Callable



def      lowerCAmelCase__			(		__magic_name__			,   __magic_name__			,   __magic_name__			,   __magic_name__ = 1_0_0			,   )						->float:
			__lowercase       =       x_start
			__lowercase       =       fnc(__magic_name__      )
			__lowercase       =       0.0
			for _ in range(__magic_name__      ):
						# Approximates small segments of curve as linear and solve
						# for trapezoidal area
						__lowercase       =       (x_end - x_start) / steps + xa
						__lowercase       =       fnc(__magic_name__      )
						area += abs(fxa + fxa      ) * (xa - xa) / 2
						# Increment step
						__lowercase       =       xa
						__lowercase       =       fxa
			return area


if __name__ == "__main__":



					def      lowerCAmelCase__			(		__magic_name__      )						->Dict:
								return x**3 + x**2

					print('''f(x) = x^3 + x^2''')
					print('''The area between the curve, x = -5, x = 5 and the x axis is:''')
					_lowercase							=				10
					while i <= 100_000:
										print(F"with {i} steps: {trapezoidal_area(f, -5, 5, i)}")
										i *= 10







"""simple docstring"""






def      lowerCAmelCase__			(		__magic_name__      )						->int:

			if not isinstance(__magic_name__			,   __magic_name__      ):
						raise ValueError("multiplicative_persistence() only accepts integral values"      )
			if num < 0:
						raise ValueError("multiplicative_persistence() does not accept negative values"      )

			__lowercase       =       0
			__lowercase       =       str(__magic_name__      )

			while len(__magic_name__      ) != 1:
						__lowercase       =       [int(__magic_name__      ) for i in num_string]

						__lowercase       =       1
						for i in range(0			,   len(__magic_name__      )      ):
									total *= numbers[i]

						__lowercase       =       str(__magic_name__      )

						steps += 1
			return steps



def      lowerCAmelCase__			(		__magic_name__      )						->int:

			if not isinstance(__magic_name__			,   __magic_name__      ):
						raise ValueError("additive_persistence() only accepts integral values"      )
			if num < 0:
						raise ValueError("additive_persistence() does not accept negative values"      )

			__lowercase       =       0
			__lowercase       =       str(__magic_name__      )

			while len(__magic_name__      ) != 1:
						__lowercase       =       [int(__magic_name__      ) for i in num_string]

						__lowercase       =       0
						for i in range(0			,   len(__magic_name__      )      ):
									total += numbers[i]

						__lowercase       =       str(__magic_name__      )

						steps += 1
			return steps


if __name__ == "__main__":
					import doctest

					doctest.testmod()





