Created
October 25, 2018 23:14
-
-
Save Ikhiloya/2ca48e91cd2d9f8db6fac69685f7f425 to your computer and use it in GitHub Desktop.
function to reverse a string
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(text): | |
string_len = len(text) | |
new_word = '' | |
for i in text: | |
new_word += text[string_len -1] | |
string_len -=1 | |
return new_word | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment