TestaPilha.py
Programa em Python para testar a classe pilha
Size 1 kB - File type text/python-sourceFile contents
#Driver para teste da Classe Lista
#Algoritmos e Estrutura da Dados
# Prof. Tiago A. E. Ferreira
import sys
from Pilha import Stack
pilha = Stack() #inicialisa uma pilha
print"Processando uma Pilha\n"
for i in range(4):
stack.puch(i)
print stack
while not stack.isEmpty():
pop = stack.pop()
print pop, "removido da pilha \n"
print stack
Click here to get the file