+ 2
Simplify?
I think I could have done this better. I was supposed to use recursion to seperately print out the letters of an input string backwards. The codee works, but I'm pretty sure I could have done it without converting the string to a list. I also think I could have made the code more compact. I would appreciate anybody's input on this. https://code.sololearn.com/cMofjUnKLTQc/?ref=app
3 Answers
+ 5
Recursive version:
https://code.sololearn.com/cikbtnforOy2/?ref=app
+ 2
Terry Petersen
As Arsalan has demonstrated with his excellent code, you can slice and manipulate strings in a similar manner to lists
+ 2
Thank you for the answer. For some reason I didn't think I could remove letters from a string because they are considered "immutable", but I guess I misunderstood what that meant (ie. I was conflating the string itself with the variable assigned to it).