


'''simple docstring'''

def __UpperCamelCase   (			__lowerCamelCase		: float      ,  __lowerCamelCase		: float      ,  __lowerCamelCase		: 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(__lowerCamelCase      ,  __lowerCamelCase				):
          raise Exception("Years to repay must be an integer > 0"				)

     # Yearly rate is divided by 12 to get monthly rate
     _a						=		rate_per_annum / 12

     # Years to repay is multiplied by 12 to get number of payments as payment is monthly
     _a						=		years_to_repay * 12

     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()





'''simple docstring'''

from __future__ import annotations

import requests






def __UpperCamelCase   (			__lowerCamelCase		: str				)      ->     dict:







     '''simple docstring'''






     _a						=		F"https://hacker-news.firebaseio.com/v0/item/{story_id}.json?print=pretty"
     return requests.get(__lowerCamelCase				).json()






def __UpperCamelCase   (			__lowerCamelCase		: int = 10				)      ->     list[dict]:







     '''simple docstring'''






     _a						=		"https://hacker-news.firebaseio.com/v0/topstories.json?print=pretty"
     _a						=		requests.get(__lowerCamelCase				).json()[:max_stories]
     return [get_hackernews_story(__lowerCamelCase				) for story_id in story_ids]






def __UpperCamelCase   (			__lowerCamelCase		: int = 10				)      ->     str:







     '''simple docstring'''






     _a						=		hackernews_top_stories(__lowerCamelCase				)
     return "\n".join("* [{title}]({url})".format(**__lowerCamelCase				) for story in stories				)


if __name__ == "__main__":
   print(hackernews_top_stories_as_markdown())

