Q. Write a program to reverse a string using stack.


Answer :-


stack = "Path Walla"
lst = list(stack)
new_stack = ""

for i in range( len(stack) ):
	new_stack += lst.pop()

print(new_stack)

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post