Advertisement
Guest User

Untitled

a guest
May 20th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. class Data(object):
  2. def __init__(self):
  3. self._data = [1, 2 ,3]
  4.  
  5. def __iter__(self):
  6. for i in self._data:
  7. yield i
  8.  
  9. def __str__(self):
  10. return str(self._data)
  11.  
  12. def __next__(self):
  13. return self
  14.  
  15. def __iadd__(self, other):
  16. self._data.append(other)
  17. return self
  18.  
  19. def get_data(self, filename):
  20. f = open(filename, "r")
  21.  
  22.  
  23. a = Car()
  24.  
  25. for i in a:
  26. print(i)
  27.  
  28. print(a)
  29.  
  30. a+=1
  31.  
  32. print(a)
  33.  
  34. f = open("Еникеев_данные.txt", "r")
  35. print(f.readlines()[0].split(";"))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement