Given stack = ["first", "second", "third", "fourth"], use pop() with no argument to remove and print
A medium Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- medium
Problem
Given stack = ["first", "second", "third", "fourth"], use pop() with no argument to remove and print the last item. Then use pop(0) to remove and print the first item. Print the remaining list.
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a real environment and grades it automatically.