Write a program that takes a list of integers as a parameter and returns the reversed list without using the built-in ‘reverse()’ function
1
Expert's answer
2021-05-25T06:13:04-0400
def rewerse_list(l:list):
n = len(l)
rew = [0 for i in range(n)]
for i in range(n):
rew[i] = l[n-i-1]
return rew
while True:
array = list(map(int, input().split()))
print(rewerse_list(array))
Comments
Leave a comment