Run ❯
Get your
own Python
server
❯
Run Code
Ctrl+Alt+R
Change Orientation
Ctrl+Alt+O
Change Theme
Ctrl+Alt+D
Go to Spaces
Ctrl+Alt+P
stack = [] # Push stack.append('A') stack.append('B') stack.append('C') print("Stack: ", stack) # Peek topElement = stack[-1] print("Peek: ", topElement) # Pop poppedElement = stack.pop() print("Pop: ", poppedElement) # Stack after Pop print("Stack after Pop: ", stack) # isEmpty isEmpty = not bool(stack) print("isEmpty: ", isEmpty) # Size print("Size: ",len(stack))
Stack: ['A', 'B', 'C']
Peek: C
Pop: C
Stack after Pop: ['A', 'B']
isEmpty: False
Size: 2