+ 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 ответ
+ 4
print(*[ x[1:]+x[:1]+"ay" for x in input().split()] )
13th Apr 2022, 9:37 AM
Jayakrishna 🇮🇳