Given a full name in the form of a string, the task is to print the initials of a name, in short, and surname in full.
Input: Devashish Kumar Gupta Output: D. K. Gupta Input: Ishita Bhuiya Output: I. Bhuiya
Approach: The basic approach is to extract words one by one and then print the first letter of the word, followed by a dot(.). For the surname, extract and print the whole word.
Below is the implementation of the above approach:
- Python | Print the initials of a name with last name in full
- Program to find the initials of a name.
- Program to print Hut
- Program to print 2D shapes
- Program to print the Sum of series -1 + 2 + 11 + 26 + 47 +.....
- Program to print the pattern 'G'
- Program to print DNA sequence
- Program to print the given Z Pattern
- Program to print the pattern ‘D’
- Program to print the pattern "GFG"
- Program to print the given H Pattern
- Program to print last N lines | Set-2
- Program to print pattern
- Program to print the arrow pattern
- Program to print GP (Geometric Progression)
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : AnkitRai01