You can download this code by clicking the button below.
This code is now available for download.
Converts the first letter of the input string to uppercase and the rest to lowercase.
Technology Stack : str.capitalize()
Code Type : String processing
Code Difficulty :
def capitalize_word(word):
if not isinstance(word, str):
raise ValueError("The input must be a string.")
return word.capitalize()