Answer:
Following are the code to this question:
def capital(val):#defining a method that takes string value as parameter
x=True#defining boolean variable
r=''#defining string variable
for i in val:#defining loop to convert the first character into upper case
if i.isalpha() and x:#defining condition to check input value is string
r=r+i.upper()#change value into uppercase and hold value in r variable
x=False#assign value false in boolean variable
elif i=='.' or i=='?' or i=='!':#check symbols
r=r+i#add value in r variable
x=True#assign value True in boolean variable
else:
r=r+i#add all value in r variable
return r#return r variable value
val=input()#input value in val variable
print(capital(val))#called the function which print the return value
Output:
please find the attachment.
Explanation: