



'''simple docstring'''



from __future__ import annotations

import requests



def   __lowerCAmelCase					(							lowerCamelCase   :						str					):






	'''simple docstring'''




	__lowerCAmelCase												=  f'''https://hacker-news.firebaseio.com/v0/item/{story_id}.json?print=pretty'''
	return requests.get(lowerCamelCase					).json()



def   __lowerCAmelCase					(							lowerCamelCase   :						int = 10					):






	'''simple docstring'''




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



def   __lowerCAmelCase					(							lowerCamelCase   :						int = 10					):






	'''simple docstring'''




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


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




'''simple docstring'''



from __future__ import annotations



def   __lowerCAmelCase					(							lowerCamelCase   :						list					):






	'''simple docstring'''




	if not nums:
		raise ValueError("List is empty"					)
	return sum(lowerCamelCase					) / len(lowerCamelCase					)


if __name__ == "__main__":
	import doctest

	doctest.testmod()