Skip to content

Commit

Permalink
Create reverse_string.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ibnahmadbello authored Oct 17, 2018
1 parent da0415c commit 3fbb9e1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions String/Reverse String/reverse_string.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
def reverse(string):
return string[::-1]

if __name__ == '__main__':
print(reverse("reverse")) # Output "esrever"
print(reverse("Three can keep a secret, if two of them are dead")) # Output "daed era meht fo owt fi ,terces a peek nac eerhT"
print(reverse("ACM-ICPC-Algorithms")) # Output "smhtiroglA-CPCI-MCA"

0 comments on commit 3fbb9e1

Please sign in to comment.