Use list as a stack: push onto stack : Stack « Data Structure « Python






Use list as a stack: push onto stack

Use list as a stack: push onto stack
L = []
L.append(1)                    # push onto stack
L.append(2)
print L


           
       








Related examples in the same category

1.Use List as a stack: push and popUse List as a stack: push and pop