python for 无限循环

1 class Infinit:
2     def __iter__(self):
3         return self
4     
5     def __next__(self):
6         return None
7  
8 for i in Infinit():
9     print("好嗨哟,你是不是学会了for的无限循环!")

 

posted on 2019-05-30 16:44  林肯公园  阅读(1516)  评论(0编辑  收藏  举报

导航