3 ms·
I would answer : def reverse(str): return str[::-1] Am I missing the point ?
by column 13y ago
I would answer :
def reverse(str):
return str[::-1]
Am I missing the point ?
- prezjordan 13y agoThat creates a new string (the one returned) :)
- freework 13y agoThats what I would do. Then again, I always get rejected when I do these type of interviews...