3 ms·
Actually, how to reverse a string in Python is just "s[::-1]" -- you omitted the printing from the C++ version. In terms of readability, they both beg the ques
by newobj 14y ago
Actually, how to reverse a string in Python is just "s[::-1]" -- you omitted the printing from the C++ version.
In terms of readability, they both beg the question - is the reversed string ever actually held in memory at some point or can it occur lazily via latent reverse iteration?
I mean is the alleged readability of either language really answering any important questions?