Add files via upload
This commit is contained in:
parent
0c26223055
commit
3fb4cf4c20
14
man.py
14
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":
|
||||
|
Loading…
x
Reference in New Issue
Block a user