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


CCC Online Test 2021 CCC Practice Test Hindi Python Programming Tutorials 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 Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Naukari Notification Best Website and Software Company in Allahabad Sarkari Exam Quiz