Skip to content

Commit

Permalink
code
Browse files Browse the repository at this point in the history
  • Loading branch information
ArwaAbdelkhalik committed Jan 11, 2025
1 parent 86eb7a3 commit c8221e4
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions solutions/capitalize_string.py
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()

0 comments on commit c8221e4

Please sign in to comment.