Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. class Zoznam:
  2. def __init__(self):
  3. self.zoz = []
  4. def pridaj(self, prvok):
  5. if prvok in self.zoz:
  6. print("Už sa nachádza!")
  7. else:
  8. self.zoz.append(prvok)
  9. def vyhod(self, prvok):
  10. a = self.zoz.index(prvok)
  11. self.zoz.pop(a)
  12. def je_v_zozname(self, prvok):
  13. if prvok in self.zoz:
  14. return True
  15. else:
  16. return False
  17. def vypis(self):
  18. print("zoznam:", end=" ")
  19. for c in self.zoz:
  20. print(c, end=", ")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement