Skip to content

Instantly share code, notes, and snippets.

@kks32
Created June 16, 2018 07:59
Show Gist options
  • Save kks32/668d7bed76a97e88578187b9ff428f9a to your computer and use it in GitHub Desktop.
Save kks32/668d7bed76a97e88578187b9ff428f9a to your computer and use it in GitHub Desktop.
Python reverse
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