Created
January 15, 2022 16:16
-
-
Save b1ek/d0b9e88de14cf9ba66bd48abc0c80cf2 to your computer and use it in GitHub Desktop.
reverse python array
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_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