__next__()详解编程语言

 def f1(n): 
     m=n 
     while True: 
         m+=1 
         yield m 
 a=f1(5) 
 print(a.__next__())

结果:6

原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/tech/pnotes/17099.html

(0)
上一篇 2021年7月19日 19:54
下一篇 2021年7月19日 19:54

相关推荐

发表回复

登录后才能评论