How do I bring the first letter to the back and add "ay" to it? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How do I bring the first letter to the back and add "ay" to it?

I want to bring the first letter of a word to the last and add "ay" to it. Suppose there is a word "neverland", I want to convert it to "everlandnay". Just like that how can I do the same for all of the words in a sentence.

17th May 2020, 3:22 PM
Asim Yadav
Asim Yadav - avatar
2 Answers
+ 1
Dilyorbek Valijonov It's okay, he will learn eventually, calm down :)
17th May 2020, 3:30 PM
Infinity
Infinity - avatar
0
Use slicing in python str= str[1:]+str[0]+"ay"
17th May 2020, 3:24 PM
Infinity
Infinity - avatar