(bbc_news_api_key: str)
| 13 | |
| 14 | |
| 15 | def fetch_bbc_news(bbc_news_api_key: str) -> None: |
| 16 | # fetching a list of articles in json format |
| 17 | bbc_news_page = httpx.get(_NEWS_API + bbc_news_api_key, timeout=10).json() |
| 18 | # each article in the list is a dict |
| 19 | for i, article in enumerate(bbc_news_page["articles"], 1): |
| 20 | print(f"{i}.) {article['title']}") |
| 21 | |
| 22 | |
| 23 | if __name__ == "__main__": |
no test coverage detected