Computer Science
Write an algorithm to push an element into the Stack.
Python Stack
2 Likes
Answer
An algorithm to push an element into the Stack is as follows:
- START
- Stack = list() or Stack = [] #Initialize a Stack using list
- element = input("Enter the value to be added in the stack:")
- Stack.append(element) #Adding element into list
- END
Answered By
1 Like