Skip to content

Instantly share code, notes, and snippets.

@b1ek
Created January 15, 2022 16:16
Show Gist options
  • Save b1ek/d0b9e88de14cf9ba66bd48abc0c80cf2 to your computer and use it in GitHub Desktop.
Save b1ek/d0b9e88de14cf9ba66bd48abc0c80cf2 to your computer and use it in GitHub Desktop.
reverse python array
def reverse_array(array: list) -> list:
out = [];
i = len(array) - 1;
while (1):
out.append(array[i]);
if (i == 0): return out;
i -= 1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment