Answer:
Following are the code to this question:
def get_initials(the_name): #defining a method get_initials
name = the_name.split(" ") #defining name variable that splits value
val = ''#defining a string variable val
for n in name: #defining loop to convert value into upper case and store first character
val = val + n[0].upper() + "." # use val variable to hold value
return val # return val
print(get_initials("Gloria kind of a big deal Tropalogos"))#call method and print return value
print(get_initials("Homer J Simpson"))#call method and print return value
print(get_initials("John Q Public")) #call method and print return value
Output:
J.Q.P.
H.J.S.
G.K.O.A.B.D.T.
Explanation:
In the given code, the last is incorrect because if we pass the value that is "Gloria kind of a big deal Tropalogos" so, will not give G.O.O.D. instead of that it will return G.K.O.A.B.D.T. So, the program description can be given as follows: