
"""simple docstring"""





def 	__a     (		__lowerCamelCase  ):
   UpperCAmelCase_					:					Any			     =    abs(__lowerCamelCase  )
   UpperCAmelCase_					:					int			     =    0
   while n > 0:
      res += n % 10
      n //= 10
   return res







def 	__a     (		__lowerCamelCase  ):
   UpperCAmelCase_					:					Optional[Any]			     =    abs(__lowerCamelCase  )
   return n if n < 10 else n % 10 + sum_of_digits(n // 10  )







def 	__a     (		__lowerCamelCase  ):
   return sum(int(__lowerCamelCase  ) for c in str(abs(__lowerCamelCase  )  )  )







def 	__a     (		):
   from collections.abc import Callable
   from timeit import timeit

   def benchmark_a_function(__lowerCamelCase,		__lowerCamelCase  ) -> None:
      UpperCAmelCase_					:					Any			     =    f"""{func.__name__}({value})"""
      UpperCAmelCase_					:					int			     =    timeit(f"""__main__.{call}""",		setup="import __main__"  )
      print(f"""{call:56} = {func(__lowerCamelCase  )} -- {timing:.4f} seconds"""  )

   for value in (26_2144, 1125_8999_0684_2624, 126_7650_6002_2822_9401_4967_0320_5376):
      for func in (sum_of_digits, sum_of_digits_recursion, sum_of_digits_compact):
         benchmark_a_function(__lowerCamelCase,		__lowerCamelCase  )
      print()


if __name__ == "__main__":
    import doctest

    doctest.testmod()
    benchmark()




"""simple docstring"""





from __future__ import annotations







def 	__a     (		__lowerCamelCase,		__lowerCamelCase,		__lowerCamelCase  ):
   if (voltage, current, resistance).count(0  ) != 1:
      raise ValueError("One and only one argument must be 0"  )
   if resistance < 0:
      raise ValueError("Resistance cannot be negative"  )
   if voltage == 0:
      return {"voltage": float(current * resistance  )}
   elif current == 0:
      return {"current": voltage / resistance}
   elif resistance == 0:
      return {"resistance": voltage / current}
   else:
      raise ValueError("Exactly one argument must be 0"  )


if __name__ == "__main__":
    import doctest

    doctest.testmod()


