(bbc_news_api_key: str)
| 4 | |
| 5 | |
| 6 | def fetch_bbc_news(bbc_news_api_key: str) -> None: |
| 7 | # fetching a list of articles in json format |
| 8 | bbc_news_page = requests.get(_NEWS_API + bbc_news_api_key).json() |
| 9 | # each article in the list is a dict |
| 10 | for news, article in enumerate(bbc_news_page["articles"], 1): |
| 11 | print(f"{news}.) {article['title']}") |
| 12 | |
| 13 | |
| 14 | if __name__ == "__main__": |