Code:
sentence = str ( input ( "Enter a sentence:" ) )
sentence = sentence.split ( )

new = ""
for word in sentence:
    wordi = ord ( word[ 0 ] )
    cap = word[ 0 ]
    a = chr ( (ord ( cap ) - 32) )
    word1 = word.replace ( word[ 0 ] ,a )

    if wordi <= 122 and wordi >= 97:
        new = new + word1 + " "
    else:
...