




from __future__ import annotations

from collections.abc import Callable

def       __lowerCAmelCase (   snake_case__ ,				snake_case__ ,				snake_case__ ,				snake_case__ = 100 ,				):
			__UpperCamelCase				:      Any									=       x_start
			__UpperCamelCase				:      List[str]									=       fnc(snake_case__						)
			__UpperCamelCase				:      str									=       0.0

			for _ in range(snake_case__						):
						# Approximates small segments of curve as linear and solve
						# for trapezoidal area
						__UpperCamelCase				:      Tuple									=       (x_end - x_start) / steps + xa
						__UpperCamelCase				:      Tuple									=       fnc(snake_case__						)
						area += abs(fxa + fxa						) * (xa - xa) / 2

						# Increment step
						__UpperCamelCase				:      Union[str, Any]									=       xa
						__UpperCamelCase				:      Optional[int]									=       fxa
			return area


if __name__ == "__main__":

				def       __lowerCAmelCase (   snake_case__						):
							return x**3

				print('''f(x) = x^3''')
				print('''The area between the curve, x = -10, x = 10 and the x axis is:''')
				_lowerCAmelCase				     = 10
				while i <= 100000:
								_lowerCAmelCase				     = trapezoidal_area(f, -5, 5, i)
								print(f'with {i} steps: {area}')
								i *= 10









'''simple docstring'''






from doctest import testmod
from math import sqrt

def       __lowerCAmelCase (   snake_case__						):
			__UpperCamelCase				:      list[int]									=       []
			if num < 1:
						return facs
			facs.append(1						)
			if num == 1:
						return facs
			facs.append(snake_case__						)
			for i in range(2 ,				int(sqrt(snake_case__						)						) + 1						):
						if num % i == 0:  # If i is a factor of num
									facs.append(snake_case__						)
									__UpperCamelCase				:      List[str]									=       num // i  # num//i is the other factor of num
									if d != i:  # If d and i are distinct
												facs.append(snake_case__						)  # we have found another factor
			facs.sort()
			return facs


if __name__ == "__main__":
				testmod(name='''factors_of_a_number''', verbose=True)



