Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Trem(object):
- def __init__(self, vagoes):
- self.vagoes = vagoes
- def __iter__(self):
- for vagao in range(self.vagoes):
- yield vagao
- trens = Trem(10)
- for vagao in trens:
- print(vagao)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement