Skip to content

Instantly share code, notes, and snippets.

@yokolet
Created September 11, 2018 03:11
Show Gist options
  • Select an option

  • Save yokolet/c1002c72c08c6e0fa2fead56ec8dbebb to your computer and use it in GitHub Desktop.

Select an option

Save yokolet/c1002c72c08c6e0fa2fead56ec8dbebb to your computer and use it in GitHub Desktop.
Reverse String
"""
Description:
Write a function that takes a string as input and returns the string reversed.
Example:
Input: "A man, a plan, a canal: Panama"
Output: "amanaP :lanac a ,nalp a ,nam A"
"""
# runs very fast :)
def reverseString(s):
"""
:type s: str
:rtype: str
"""
return s[::-1]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment