Capitalizes all letters in a given article title. args: title (str): The title to format. returns: str: Title in uppercase with surrounding spaces removed.
(title)
| 102 | |
| 103 | |
| 104 | def capitalize_title(title): # pytest in test file |
| 105 | """ |
| 106 | Capitalizes all letters in a given article title. |
| 107 | |
| 108 | args: |
| 109 | title (str): The title to format. |
| 110 | |
| 111 | returns: |
| 112 | str: Title in uppercase with surrounding spaces removed. |
| 113 | """ |
| 114 | return title.upper().strip() |
| 115 | |
| 116 | |
| 117 | def fetch_news(api_key, query, max_articles=5): # no pytest |