Created
May 5, 2014 18:52
-
-
Save Restuta/11544592 to your computer and use it in GitHub Desktop.
Helen's poor attempt with 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_string(list): | |
list_length = len(list) | |
for i in range(0, list_length//2, 1): | |
temp_letter = list[i] | |
list[i] = list[list_length - i - 1] | |
list[list_length - i - 1] = temp_letter | |
return list | |
new_string = 'ejahdjb ajebdsjb j,awbed ,ajwebdj' | |
print reverse_string(new_string) | |
i = 3 | |
print new_string[0] | |
print new_string[i - 2] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment