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
adda
Game4
H.W 5-Solution
kawaii
shuru15
Game2
75
5 ki table
Lab_I_1_25_11_2020
Swapping.py