


"""simple docstring"""







def 					a__ (       _UpperCamelCase ):





						"""simple docstring"""

						UpperCAmelCase__		=    [list(_UpperCamelCase ) for row in matrix]
						if matrix and isinstance(_UpperCamelCase	,			_UpperCamelCase ):
												if isinstance(matrix[0]	,			_UpperCamelCase ):
																		UpperCAmelCase__		=    0
																		for row in matrix:
																								if prev_len == 0:
																														UpperCAmelCase__		=    len(_UpperCamelCase )
																														UpperCAmelCase__		=    True
																								else:
																														UpperCAmelCase__		=    prev_len == len(_UpperCamelCase )
												else:
																		UpperCAmelCase__		=    True
						else:
												UpperCAmelCase__		=    False

						return result






def 					a__ (       _UpperCamelCase ):





						"""simple docstring"""

						if check_matrix(_UpperCamelCase ) and len(_UpperCamelCase ) > 0:
												UpperCAmelCase__		=    [list(_UpperCamelCase ) for row in a]
												UpperCAmelCase__		=    len(_UpperCamelCase )
												if isinstance(a[0]	,			_UpperCamelCase ):
																		UpperCAmelCase__		=    len(a[0] )
												else:
																		for dat in a:
																								print(_UpperCamelCase )
																		return

												# horizotal printing increasing
												for i in range(0	,			_UpperCamelCase ):
																		print(a[0][i] )
												# vertical printing down
												for i in range(1	,			_UpperCamelCase ):
																		print(a[i][mat_col - 1] )
												# horizotal printing decreasing
												if mat_row > 1:
																		for i in range(mat_col - 2	,			-1	,			-1 ):
																								print(a[mat_row - 1][i] )
        # vertical printing up
												for i in range(mat_row - 2	,			0	,			-1 ):
																		print(a[i][0] )
												UpperCAmelCase__		=    [row[1 : mat_col - 1] for row in a[1 : mat_row - 1]]
												if len(_UpperCamelCase ) > 0:
																		spiral_print_clockwise(_UpperCamelCase )
												else:
																		return
						else:
												print('''Not a valid matrix''' )
												return






def 					a__ (       _UpperCamelCase ):





						"""simple docstring"""

						if matrix:
												return list(matrix.pop(0 ) ) + spiral_traversal(list(zip(*_UpperCamelCase ) )[::-1] )
						else:
												return []


# driver code
if __name__ == "__main__":
						import doctest

						doctest.testmod()

						__a			 =   [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12]]
						spiral_print_clockwise(a)



"""simple docstring"""







from __future__ import annotations

from collections.abc import Callable






def 					a__ (       _UpperCamelCase	,			_UpperCamelCase	,			_UpperCamelCase	,			_UpperCamelCase = 100	,			):





						"""simple docstring"""

						UpperCAmelCase__		=    x_start
						UpperCAmelCase__		=    fnc(_UpperCamelCase )
						UpperCAmelCase__		=    0.0

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

												# Increment step
												UpperCAmelCase__		=    xa
												UpperCAmelCase__		=    fxa
						return area


if __name__ == "__main__":






						def 					a__ (       _UpperCamelCase ):





												"""simple docstring"""

												return x**3

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