


'''simple docstring'''



from collections.abc import Callable






def   lowerCamelCase							(_SCREAMING_SNAKE_CASE      :   Callable[[float], float]						,      _SCREAMING_SNAKE_CASE      :   float						,      _SCREAMING_SNAKE_CASE      :   float   ):
					__a			:       float					    =  a
					__a			:       float					    =  b
					if function(_SCREAMING_SNAKE_CASE   ) == 0:  # one of the a or b is a root for the function
										return a
					elif function(_SCREAMING_SNAKE_CASE   ) == 0:
										return b
					elif (
					    function(_SCREAMING_SNAKE_CASE   ) * function(_SCREAMING_SNAKE_CASE   ) > 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:
										__a			:       float					    =  start + (end - start) / 2.0
										while abs(start - mid   ) > 10**-7:  # until precisely equals to 10^-7
															if function(_SCREAMING_SNAKE_CASE   ) == 0:
																				return mid
															elif function(_SCREAMING_SNAKE_CASE   ) * function(_SCREAMING_SNAKE_CASE   ) < 0:
																				__a			:       List[Any]					    =  mid
															else:
																				__a			:       List[Any]					    =  mid
															__a			:       Dict					    =  start + (end - start) / 2.0
										return mid






def   lowerCamelCase							(_SCREAMING_SNAKE_CASE      :   float   ):
					return x**3 - 2 * x - 5


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

	import doctest

	doctest.testmod()







'''simple docstring'''



import requests

__lowercase	:						Tuple       =	''  # <-- Put your OpenWeatherMap appid here!
__lowercase	:						Tuple       =	'https://api.openweathermap.org/data/2.5/'






def   lowerCamelCase							(_SCREAMING_SNAKE_CASE      :   str = "Chicago"						,      _SCREAMING_SNAKE_CASE      :   str = APPID   ):
					return requests.get(URL_BASE + 'weather'						,      params=locals()   ).json()






def   lowerCamelCase							(_SCREAMING_SNAKE_CASE      :   str = "Kolkata, India"						,      _SCREAMING_SNAKE_CASE      :   str = APPID   ):
					return requests.get(URL_BASE + 'forecast'						,      params=locals()   ).json()






def   lowerCamelCase							(_SCREAMING_SNAKE_CASE      :   float = 5_5.6_8						,      _SCREAMING_SNAKE_CASE      :   float = 1_2.5_7						,      _SCREAMING_SNAKE_CASE      :   str = APPID   ):
					return requests.get(URL_BASE + 'onecall'						,      params=locals()   ).json()


if __name__ == "__main__":
	from pprint import pprint

	while True:
		__lowercase	:						Dict       =	input('Enter a location:').strip()
		if location:
			pprint(current_weather(location))
		else:
			break



