


def    snake_case_     (  snake_case     )  ->				int:
       lowercase__:   Union[str, Any]  			=   abs(__lowercase     )
       lowercase__:   Optional[int]  			=   0
       while n > 0:
              res += n % 10
              n //= 10
       return res




def    snake_case_     (  snake_case     )  ->				int:
       lowercase__:   Dict  			=   abs(__lowercase     )
       return n if n < 10 else n % 10 + sum_of_digits(n // 10     )




def    snake_case_     (  snake_case     )  ->				int:
       return sum(int(__lowercase     ) for c in str(abs(__lowercase     )     )     )




def    snake_case_     (  )  ->				None:
       from collections.abc import Callable
       from timeit import timeit

       def benchmark_a_function(snake_case			,							snake_case     ) -> None:
              lowercase__:   Tuple  			=   f'{func.__name__}({value})'
              lowercase__:   Optional[int]  			=   timeit(f'__main__.{call}'			,							setup='import __main__'     )
              print(f'{call:56} = {func(__lowercase     )} -- {timing:.4f} seconds'     )

       for value in (26_21_44, 11_25_89_99_06_84_26_24, 1_26_76_50_60_02_28_22_94_01_49_67_03_20_53_76):
              for func in (sum_of_digits, sum_of_digits_recursion, sum_of_digits_compact):
                     benchmark_a_function(__lowercase			,							__lowercase     )
              print()


if __name__ == "__main__":
 import doctest

 doctest.testmod()
 benchmark()




def        a_		(       __lowercase   :	str ) ->  int:
			_snake_case		=			hex_num.strip()
			if not hex_num:
						raise ValueError('No value was passed to the function' )

			_snake_case		=			hex_num[0] == '-'
			if is_negative:
						_snake_case		=			hex_num[1:]

			try:
						_snake_case		=			int(__lowercase       ,					16 )
			except ValueError:
						raise ValueError('Invalid value was passed to the function' )

			_snake_case		=			''
			while int_num > 0:
						_snake_case		=			str(int_num % 2 ) + bin_str
						int_num >>= 1

			return int(('-' + bin_str) if is_negative else bin_str )


if __name__ == "__main__":
			import doctest

			doctest.testmod()