Created
June 16, 2018 07:59
-
-
Save kks32/668d7bed76a97e88578187b9ff428f9a to your computer and use it in GitHub Desktop.
Python reverse
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(data_list): | |
length = len(data_list) | |
s = length | |
new_list = [None]*length | |
for item in data_list: | |
s = s - 1 | |
new_list[s] = item | |
return new_list | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment