19

Not quite a rant, but if you came here for a cool way to reverse strings in python then I've got you covered:

backwardsString = string[::-1]

Don't know why you come to devRANT for tips on python string reversal but hey

I thought it was cool at the time ::)))

Comments
  • 6
    I usually prefer to
    backwards_string = string[::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1][::-1]
    Just to make sure
  • 1
    Hi cool tip. But do you know why that works?
  • 1
    @DirtyBit ah yes don't we all
Add Comment