interplane.Get Omega
Read in your language

omega-rosetta

aien-dev/omega-rosetta

Brought by drakestapleton

branch main Branches Tags History

omega-rosetta / tasks / stack / oracle.py

16 lines · 423 bytes Raw Blame History
1# Independent reference for "Stack" (Python 3, standard library only).
2# expected.txt is this program's stdout; omc never produced it.
3stack = []
4def empty():
5 print("empty:", "no" if stack else "yes")
6empty()
7for v in (10, -20, 30):
8 stack.append(v)
9 print("push", v)
10print("peek", stack[-1])
11print("size", len(stack))
12print("pop", stack.pop())
13print("pop", stack.pop())
14empty()
15print("pop", stack.pop())
16empty()