Programming Examples

Python program to form a word by joining first character of each word


Write a Python code to enter a sentence. Form a word by joining all the first characters of each word of the sentence. Display the word.

Sample Input: Read Only Memory

Solution:

wd=""
str=input("Enter a string in mixed case : ")
str=" "+str
p=len(str)
for i in range(0,p):
       if(str[i]==' '):
               wd=wd+str[i+1]
print("New Word:",wd)
Output

Enter a string in mixed case : Read Only Memory

New Word: ROM


Online Exam Quiz for One day Exam Online Typing Test CCC Online Test 2026 Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Best Website and Software Company in Allahabad