
1. class A:
2. def __init__(self):
3. self.text = 'abc'
4. self.count = 0
5.
6. def __iter__(self):
7. return self
8.
9. def __next__(self):
10. if self.count == len(self.text):
11. raise StopIteration
12. value = self.text[self.count]
13. self.count += 1
14. return value
15.
16.
17. for x in A():
18. print(x, end='')
© Copyrights DumpsEngine 2026. All Rights Reserved
We use cookies to ensure your best experience. So we hope you are happy to receive all cookies on the DumpsEngine.
