forked from MIT-Emerging-Talent/ET6-practice-code-review
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
86eb7a3
commit c8221e4
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
""" " | ||
Created on 0084/01/2025 | ||
@author: Arwa Mohamed | ||
""" | ||
|
||
|
||
def capitalize_string(s): | ||
""" | ||
Converts all letters in a given string to uppercase. | ||
Args: | ||
s (str): The input string to be capitalized. | ||
Returns: | ||
str: A new string with all letters converted to uppercase. | ||
Raises: | ||
TypeError: If the input is not a string. | ||
Examples: | ||
>>> capitalize_string("hello") | ||
'HELLO' | ||
>>> capitalize_string("Python 123!") | ||
'PYTHON 123!' | ||
""" | ||
if not isinstance(s, str): | ||
raise TypeError("Input must be a string.") | ||
return s.upper() |