Last active
January 13, 2021 06:18
-
-
Save ayubmetah/475f534b471afe8dfa04b7b827a4273d to your computer and use it in GitHub Desktop.
Function to print strings in reverse order using python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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