Hi all,
I'm trying to use generators, however using "print(next(gen))" doesn't print anything, I obtain just "Process finished with exit code 0". Here's my code:
I'm trying to use generators, however using "print(next(gen))" doesn't print anything, I obtain just "Process finished with exit code 0". Here's my code:
def get_values(): yield "Hello" yield "World" yield 123 def get_values2(): gen = get_values() print(next(gen)) print(next(gen)) print(next(gen))
buran write Jan-16-2025, 11:57 AM:
Please, use proper tags when post code, traceback, output, etc. This time I have added tags for you.
See BBcode help for more info.
Please, use proper tags when post code, traceback, output, etc. This time I have added tags for you.
See BBcode help for more info.