Created
February 22, 2023 20:56
-
-
Save lobster1234/bd3b5e96024c34593c55a5dcc2f87755 to your computer and use it in GitHub Desktop.
This file contains hidden or 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_string(s): | |
if len(s)==1: | |
return s | |
else: | |
return s[-1]+reverse_string(s[0:len(s)-1]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment