


def        UpperCamelCase_(   lowerCamelCase_							,				lowerCamelCase_				)					->		float:
    if discount_rate < 0:
        raise ValueError('Discount rate cannot be negative'				)
    if not cash_flows:
        raise ValueError('Cash flows list cannot be empty'				)
    _lowercase :							Dict   	=	sum(
        cash_flow / ((1 + discount_rate) ** i) for i, cash_flow in enumerate(lowerCamelCase_				)				)
    return round(lowerCamelCase_							,				ndigits=2				)


if __name__ == "__main__":
      import doctest

      doctest.testmod()






from __future__ import annotations

import requests



def        UpperCamelCase_(   lowerCamelCase_				)					->		dict:
    _lowercase :							Dict   	=	F'''https://hacker-news.firebaseio.com/v0/item/{story_id}.json?print=pretty'''
    return requests.get(lowerCamelCase_				).json()



def        UpperCamelCase_(   lowerCamelCase_ = 10				)					->		list[dict]:
    _lowercase :							Dict   	=	'https://hacker-news.firebaseio.com/v0/topstories.json?print=pretty'
    _lowercase :							Dict   	=	requests.get(lowerCamelCase_				).json()[:max_stories]
    return [get_hackernews_story(lowerCamelCase_				) for story_id in story_ids]



def        UpperCamelCase_(   lowerCamelCase_ = 10				)					->		str:
    _lowercase :							Optional[int]   	=	hackernews_top_stories(lowerCamelCase_				)
    return "\n".join('* [{title}]({url})'.format(**lowerCamelCase_				) for story in stories				)


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


