+ 6
How to replace last letter of each word in string in end in python?
For example: long road - ongl oadr
3 Réponses
+ 7
Ситникова Варвара , before asking here for code, you should do a try by yourself first, and put it in playground. Then link it here. Thanks!
But to give you some hints:
(1) split the input string to individual words / elements in a list
(2) iterate through this list (each element is now a complete word)
(3) now pick word without first char + first character of word and put them together to a new word
(4) store result in a list or use print to output result
happy coding!
+ 5
Remember that strings are immutable in python
+ 4
I see youre on pig latin. Try using index slicing and see what you can do. For example
a = 'hello'
b = 'j' + a[1:]
print(b)
#jello