Reverse String
Python
Easy
3 views
Problem Description
Input is a single string s is provided (no trailing spaces needed). Output the reversed string.
Output Format
One line reversed.
Official Solution
import sys
s=sys.stdin.read()
if s is None: sys.exit(0)
if s.endswith('\
'):
s=s[:-1]
sys.stdout.write(s[::-1])
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!