



'''simple docstring'''





from __future__ import annotations

import random






class  lowerCamelCase_   :
  """simple docstring"""




  a_							 =6




  def __init__(			self				:     Tuple       ) -> int:
    __lowerCamelCase	:	str   	=			list(range(1      ,     Dice.NUM_SIDES + 1       )       )




  def 						_lowercase					(			self				:     Optional[int]       ) -> List[str]:
    return random.choice(self.sides       )




def 	a_					(							_lowerCAmelCase	,_lowerCAmelCase = 2	)				->				list[float]:
  __lowerCamelCase	:	Optional[Any]   	=			[Dice() for i in range(_lowerCAmelCase	)]
  __lowerCamelCase	:	Optional[Any]   	=			[0] * (len(_lowerCAmelCase	) * Dice.NUM_SIDES + 1)
  for _ in range(_lowerCAmelCase	):
    count_of_sum[sum(dice.roll() for dice in dices	)] += 1
  __lowerCamelCase	:	Optional[Any]   	=			[round((count * 100) / num_throws	,2	) for count in count_of_sum]
  return probability[num_dice:]  # remove probability of sums that never appear


if __name__ == "__main__":
   import doctest

   doctest.testmod()










'''simple docstring'''





import math
from timeit import timeit

def 	a_					(							_lowerCAmelCase	)				->				int:
  __lowerCamelCase	:	int   	=			0
  __lowerCamelCase	:	Optional[int]   	=			abs(_lowerCAmelCase	)
  while True:
    __lowerCamelCase	:	List[str]   	=			n // 10
    digits += 1
    if n == 0:
      break
  return digits

def 	a_					(							_lowerCAmelCase	)				->				int:
  return 1 if n == 0 else math.floor(math.log(abs(_lowerCAmelCase	)	,10	) + 1	)

def 	a_					(							_lowerCAmelCase	)				->				int:
  return len(str(abs(_lowerCAmelCase	)	)	)

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

  def benchmark_a_function(_lowerCAmelCase	,_lowerCAmelCase	) -> None:
    __lowerCamelCase	:	Any   	=			F'{func.__name__}({value})'
    __lowerCamelCase	:	int   	=			timeit(F'__main__.{call}'	,setup='import __main__'	)
    print(F'{call}: {func(_lowerCAmelCase	)} -- {timing} seconds'	)

  for value in (262144, 1125899906842624, 1267650600228229401496703205376):
    for func in (num_digits, num_digits_fast, num_digits_faster):
      benchmark_a_function(_lowerCAmelCase	,_lowerCAmelCase	)
    print()


if __name__ == "__main__":
   import doctest

   doctest.testmod()
   benchmark()






