Advertisement
Guest User

Nieobiektowy stos

a guest
Apr 9th, 2020
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.21 KB | None | 0 0
  1. def new():
  2.     return []
  3.  
  4. def empty(s):
  5.     return s == []
  6.  
  7. def pop(s):
  8.     ostatni = s.pop()
  9.     s.pop(-1)
  10.     return ostatni
  11.    
  12. def push(s, x):
  13.     s.append(x)
  14.  
  15. def top(s):
  16.     return s[-1]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement