[Tutor] any(x)

Oliver Haken Ollie.ha at outlook.com
Mon Feb 7 17:05:27 EST 2022


I have a generator to make an infinite list of numbers


Code: Select all<https://forums.sourcepython.com/viewtopic.php?t=2663#>

 t = 0
u = []
def h ():
 while True:
  t = t + 1
  u.append(t)
  yield u
h ()


But how do I use it?


Code: Select all<https://forums.sourcepython.com/viewtopic.php?t=2663#>

 z = any(u)


Thanks, Oliver

Get Outlook for iOS<https://aka.ms/o0ukef>


More information about the Tutor mailing list