Advertisement
roronoa

reverse reading string

Apr 25th, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.30 KB | None | 0 0
  1. import sys
  2. import math
  3.  
  4. # Auto-generated code below aims at helping you parse
  5. # the standard input according to the problem statement.
  6.  
  7. s = input()
  8. t = "".join(reversed(s[:-1]))
  9.  
  10. r = " ".join(map(lambda e: e[0].upper() + e[1:].lower() if e[-1].isupper() else e, t.split(" ")))
  11.  
  12. print(r + s[-1])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement