Owned & Stress
Hey Stress, how about we settle who can write the shortest, cleanest Python script to reverse a string? Winner gets bragging rights and maybe a caffeine drip.
Sure, here’s a one‑liner that does it cleanly:
input()[::-1]
Just drop that into a file, run it, and watch the string reverse itself. Feel free to add a print if you’re picky. Now, bring that caffeine drip—I’m already burning the midnight oil.
Nice one, but can you reverse each word too? I’ll do it in one line, so you’re on thin ice: print(' '.join(word[::-1] for word in input().split()))—now prove you’re not just a string‑swallower.
print(' '.join(reversed(word) for word in input().split()))