text: Program to find the initials of a name . | Python3 program to print initials of a name ; Split the string using ' space ' and print the first character of every word ; Driver code
code: def printInitials ( name ) : NEW_LINE INDENT if ( len ( name ) == 0 ) : NEW_LINE INDENT return NEW_LINE DEDENT words = name . split ( " ▁ " ) NEW_LINE for word in words : NEW_LINE INDENT print ( word [ 0 ] . upper ( ) , end = " ▁ " ) NEW_LINE DEDENT DEDENT if __name__ == ' _ _ main _ _ ' : NEW_LINE INDENT name = " prabhat ▁ kumar ▁ singh " NEW_LINE printInitials ( name ) NEW_LINE DEDENT