Is there any short way to convert iteration to list or string sentence? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Is there any short way to convert iteration to list or string sentence?

txt=input() word=txt.split() for x in word: P=x[:1]+"ay" x=x.replace(x[:1],"") x+=P

13th Apr 2022, 9:27 AM
Yasin Rahnaward
Yasin Rahnaward - avatar
1 Answer
+ 4
print(*[ x[1:]+x[:1]+"ay" for x in input().split()] )
13th Apr 2022, 9:37 AM
Jayakrishna 🇮🇳