


"""simple docstring"""






import requests

UpperCAmelCase    :     Tuple   						=		''  # <-- Put your OpenWeatherMap appid here!
UpperCAmelCase    :     Tuple   						=		'https://api.openweathermap.org/data/2.5/'
def      lowerCamelCase       (     _UpperCamelCase		:      str = "Chicago"       ,			_UpperCamelCase		:      str = APPID							)		->       dict:

							'''simple docstring'''



							return requests.get(URL_BASE + """weather"""       ,			params=locals()							).json()
def      lowerCamelCase       (     _UpperCamelCase		:      str = "Kolkata, India"       ,			_UpperCamelCase		:      str = APPID							)		->       dict:

							'''simple docstring'''



							return requests.get(URL_BASE + """forecast"""       ,			params=locals()							).json()
def      lowerCamelCase       (     _UpperCamelCase		:      float = 55.68       ,			_UpperCamelCase		:      float = 12.57       ,			_UpperCamelCase		:      str = APPID							)		->       dict:

							'''simple docstring'''



							return requests.get(URL_BASE + """onecall"""       ,			params=locals()							).json()


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

							while True:
														UpperCAmelCase    :     Optional[Any]   						=		input('Enter a location:').strip()
														if location:
																					pprint(current_weather(location))
														else:
																					break




"""simple docstring"""






def      lowerCamelCase       (     _UpperCamelCase		:      float       ,			_UpperCamelCase		:      float       ,			_UpperCamelCase		:      int							)		->       float:

							'''simple docstring'''



							if principal <= 0:
														raise Exception("""Principal borrowed must be > 0"""							)
							if rate_per_annum < 0:
														raise Exception("""Rate of interest must be >= 0"""							)
							if years_to_repay <= 0 or not isinstance(_UpperCamelCase       ,			_UpperCamelCase							):
														raise Exception("""Years to repay must be an integer > 0"""							)

							# Yearly rate is divided by 12 to get monthly rate
							__UpperCAmelCase   :						List[Any]      							=					rate_per_annum / 1_2

							# Years to repay is multiplied by 12 to get number of payments as payment is monthly
							__UpperCAmelCase   :						Optional[int]      							=					years_to_repay * 1_2

							return (
							    principal
							    * rate_per_month
							    * (1 + rate_per_month) ** number_of_payments
							    / ((1 + rate_per_month) ** number_of_payments - 1)
							)


if __name__ == "__main__":
							import doctest

							doctest.testmod()
