How can change the place of 1 character in an array? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How can change the place of 1 character in an array?

so for example; array1 = ["apple", "pear", "orange"] how can i change the first letter's place. for example: apple = pplea pear = earp orange = rangeo

15th Mar 2019, 3:18 PM
Jordi
Jordi - avatar
2 Answers
+ 1
Are you always putting the first letter at the end? text = “apple” text = text[1:] + text[0] print(text)
15th Mar 2019, 3:33 PM
Russ
Russ - avatar
0
Thank you it works and yeah always at the end
15th Mar 2019, 3:38 PM
Jordi
Jordi - avatar