Answer to Question #196891 in Python for Jerry

Question #196891
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))

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS