From 3fb4cf4c20fd3ee9392edc3ad4d608850b775c9f Mon Sep 17 00:00:00 2001 From: Can202 <67566612+Can202@users.noreply.github.com> Date: Fri, 9 Apr 2021 13:04:55 -0400 Subject: [PATCH] Add files via upload --- man.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/man.py b/man.py index d17fc20..6292b4c 100644 --- a/man.py +++ b/man.py @@ -10,7 +10,7 @@ def pair(num): result = False return result -#Use man.ordern([0,2,3,20,5,2,50]), the result is order +#Use man.orderArray([0,2,3,20,5,2,50]), the result is order def orderArray(array): numberis = len(array) torepeat = False @@ -33,6 +33,18 @@ def orderArray(array): return array +#Use man.reverseArray([0,2,5,1,5,34]), the result is reverse +def reverseArray(array): + numberis = len(array) + numberis2 = numberis // 2 + for i in range(numberis2): + y = numberis - i - 1 + m = array[i] + array[i] = array[y] + array[y] = m + return array + + #Use man.paused() def paused(): if os.name == "posix" or os.name == "mac":