Advertisement
jtentor

DemoStack1 - Python - DemoStack1 (lista)

May 11th, 2020
1,174
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/env python
  2. # -*- coding: UTF-8 -*-
  3. __author__ = 'Julio Tentor <jtentor@fi.unju.edu.ar>'
  4.  
  5.  
  6. from StackList 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
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement