capitalizes the first letter of a sentence or word capitalizehello world hello world capitalize123 hello world 123 hello world capitalize hello world hello world capitalizea a capitalize create a dictionary that maps lowercase letters to uppercase letters capitalize the first character if it s a lowercase letter concatenate the capitalized character with the rest of the string capitalizes the first letter of a sentence or word capitalize hello world hello world capitalize 123 hello world 123 hello world capitalize hello world hello world capitalize a a capitalize create a dictionary that maps lowercase letters to uppercase letters capitalize the first character if it s a lowercase letter concatenate the capitalized character with the rest of the string
from string import ascii_lowercase, ascii_uppercase


def capitalize(sentence: str) -> str:
    
    if not sentence:
        return ""

    
    
    
    lower_to_upper = dict(zip(ascii_lowercase, ascii_uppercase))
    return lower_to_upper.get(sentence[0], sentence[0]) + sentence[1:]


if __name__ == "__main__":
    from doctest import testmod

    testmod()