Skip to content

Instantly share code, notes, and snippets.

@MohanSha
Created February 13, 2018 08:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MohanSha/e5f07eba8bb9eeab07a6177b49ed65aa to your computer and use it in GitHub Desktop.
Save MohanSha/e5f07eba8bb9eeab07a6177b49ed65aa to your computer and use it in GitHub Desktop.
Enter a string and the program will reverse it and print it out.
# Reverse a String
# Enter a string and the program will reverse it and print it out.
def reverse_string(string):
return string[::-1]
string = raw_input('String: ')
print reverse_string(string)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment