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的無限循環!")
相關文章
相關標籤/搜索