





from collections.abc import Callable
def      _lowerCAmelCase(	__A   ,       __A   ,       __A			):
  UpperCAmelCase					      =  a
  UpperCAmelCase					      =  b
  if function(__A			) == 0:  # one of the a or b is a root for the function
    return a
  elif function(__A			) == 0:
    return b
  elif (
      function(__A			) * function(__A			) > 0
  ):  # if none of these are root and they are both positive or negative,
    # then this algorithm can't find the root
    raise ValueError("could not find root in given interval."			)
  else:
    UpperCAmelCase					      =  start + (end - start) / 2.0
    while abs(start - mid			) > 10**-7:  # until precisely equals to 10^-7
      if function(__A			) == 0:
        return mid
      elif function(__A			) * function(__A			) < 0:
        UpperCAmelCase					      =  mid
      else:
        UpperCAmelCase					      =  mid
      UpperCAmelCase					      =  start + (end - start) / 2.0
    return mid
def      _lowerCAmelCase(	__A			):
  return x**3 - 2 * x - 5


if __name__ == "__main__":
      print(bisection(f, 1, 1000))

      import doctest

      doctest.testmod()






def      _lowerCAmelCase(	__A			):

  if not isinstance(__A   ,       __A			):
    raise TypeError("only integers accepted as input"			)
  else:
    UpperCAmelCase					      =  str(abs(__A			)			)
    UpperCAmelCase					      =  [list(__A			) for char in range(len(__A			)			)]
    for index in range(len(__A			)			):
      num_transpositions[index].pop(__A			)
    return max(
        int("".join(list(__A			)			)			) for transposition in num_transpositions			)


if __name__ == "__main__":
      __import__("doctest").testmod()



