






from __future__ import annotations

from collections.abc import Callable
def 		_a					(   a				:Callable[[int | float], int | float]			,							a				:int | float			,							a				:int | float			,							a				:int = 100			,							)							->    float:
 a							=   x_start
 a							=   fnc(a				)
 a							=   0.0

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

  # Increment step
  a							=   xa
  a							=   fxa
 return area


if __name__ == "__main__":
     def 		_a					(   a				:Optional[Any]				)							->    List[str]:
      return x**3

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










def 		_a					(   a				:float				)							->    float:
 return -num if num < 0 else num
def 		_a					(   a				:list[int]				)							->    int:
 if len(a				) == 0:
  raise ValueError('''abs_min() arg is an empty sequence'''				)
 a							=   x[0]
 for i in x:
  if abs_val(a				) < abs_val(a				):
   a							=   i
 return j
def 		_a					(   a				:list[int]				)							->    int:
 if len(a				) == 0:
  raise ValueError('''abs_max() arg is an empty sequence'''				)
 a							=   x[0]
 for i in x:
  if abs(a				) > abs(a				):
   a							=   i
 return j
def 		_a					(   a				:list[int]				)							->    int:
 if len(a				) == 0:
  raise ValueError('''abs_max_sort() arg is an empty sequence'''				)
 return sorted(a			,							key=a				)[-1]
def 		_a					(   )							->    int:
 assert abs_val(0				) == 0
 assert abs_val(34				) == 34
 assert abs_val(-100_000_000_000				) == 100_000_000_000

 a							=   [-3, -1, 2, -11]
 assert abs_max(a				) == -11
 assert abs_max_sort(a				) == -11
 assert abs_min(a				) == -1


if __name__ == "__main__":
     import doctest

     doctest.testmod()

     test_abs_val()
     print(abs_val(-34))  # --> 34


