Advertisement
jtentor

DemoStack1 - Python - DemoStack1 (arreglo)

May 11th, 2020
1,317
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # -*- coding: UTF-8 -*-
  3. __author__ = 'Julio Tentor <jtentor@fi.unju.edu.ar>'
  4.  
  5.  
  6. from StackArray import Stack
  7.  
  8. print("Demo de Stack en Python")
  9.  
  10. miPila = Stack(5)
  11.  
  12. miPila.Push('a')
  13. miPila.Push("Hola que tal")
  14. miPila.Push(8956)
  15.  
  16. while (not miPila.Empty):
  17.     print(miPila.Pop())
  18.  
  19. try:
  20.     print(miPila.Pop())
  21. except ValueError as err:
  22.     for a in err.args:
  23.         print(a)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement