Problem 183027 · easy · Phase 01 Prerequisites & Setup

Mirror Writing

strings · slicing · iteration

Leonardo da Vinci wrote his notes back to front. Given a string s, return it reversed, keeping every character (spaces and punctuation included).

Examples

Input:  s = "stressed"
Output: "desserts"

Input:  s = "a b!"
Output: "!b a"

Constraints

  • 0 <= len(s) <= 2000
  • s may contain any printable characters

Goals

  • Reverse a string
  • Keep every character including spaces and punctuation
Starting Python…