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的无限循环!")

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-05
  • 2021-09-21
  • 2022-01-06
  • 2021-09-28
  • 2022-01-09
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-30
  • 2022-12-23
相关资源
相似解决方案