Write a simple python program to take input from user calculate it's the length and print it in abbreviation form with a full stop after each character. For example, if the user inputs his name as abc then the output produced have to be a . b . c .
# The required output format is as-
Please input your name
your name is 3 characters long
a . b . c .
Share
Answer:A B C
Explanation:def printInitials(name):
if(len(name) == 0):
return
print(name[0].upper()),
for i in range(1, len(name) - 1):
if (name[i] == ' '):
print (name[i + 1].upper()),
def main():
name = "apple banana car"
printInitials(name)
if __name__=="__main__":
main()