Question: I'm fairly new to Python and had a question on the push function for this stack class. What is the difference between calling the function
I'm fairly new to Python and had a question on the push function for this stack class.
What is the difference between calling the function like this myStack.push(somevalue) compared to myStack.push(somevalue, [ ] ) ?
I'm more familiar with C++, and find myself getting confused very easily when looking at Python code.

class Stack: "A container with a last-in-first-out (LIFO) queuing policy." def _init__(self): self.list = [] | def push(self, item): "Push 'item' onto the stack" self.list.append(item) def pop (self): "Pop the most recently pushed item from the stack" return self.list.pop() def isEmpty (self): "Returns true if the stack is empty" return len(self.list) == 0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
