Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Python: Stack Simple I
#python 3.5.2 import random def createS(size): astack=[] for i in range(size): astack.append(i) return astack def createRandStack(size): a=[] for i in range(size): a.append(random.randrange(size)) return a def emptyS(): return [] def insertS(stack,item): stack.append(item) def popS(stack): return stack.pop() ast=createS(100) bst=createRandStack(20) print(ast.pop()) print(ast) print(popS(ast)) print(bst)
run
|
edit
|
history
|
help
0
short hand if else
linked_lists
EJ2_PYTHON_20.321.212-7
PyGen
Hello. Py
My world
147
24jan py
kenken1
test2.py