How to move the first letter of a word to the end

后端 未结 3 1685
梦如初夏
梦如初夏 2020-12-06 16:01

I need to remove the first letter of a word and move it to the end, for example:

word = \'whatever\'
# I want to convert it to \'hateverw\'

3条回答
  •  渐次进展
    2020-12-06 16:17

    Here is what I did:

    wrd = input("Give me a word: ")
    
    pig = wrd[1:] + wrd[0] + "ay"
    
    print(wrd, "in Pig Latin it is:", pig.lower())
    

提交回复
热议问题