SHARE
TWEET

Untitled

a guest May 20th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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(";"))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top