Skip to content

Instantly share code, notes, and snippets.

@ayubmetah
Last active January 13, 2021 06:18
Show Gist options
  • Save ayubmetah/475f534b471afe8dfa04b7b827a4273d to your computer and use it in GitHub Desktop.
Save ayubmetah/475f534b471afe8dfa04b7b827a4273d to your computer and use it in GitHub Desktop.
Function to print strings in reverse order using python
def reverse(lines):
return "Reverse order: " + lines[::-1] + "\n" + "Normal Order: " + lines
print(reverse("I am printing a sentence in reverse order"))
print(reverse("printing strings in reverse order using python"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment