tags:

views:

188

answers:

2

What is the difference between yield keyword in Python and yield keyword in C#?

+12  A: 

C#'s yield return is equivalent to Python's yield , and yield break is just return in Python.

Other than those minor differences, they have basically the same purpose.

John Millikin
+11  A: 

This may help you understand it : Iterators in C#, Python, and Ruby

Soufiane Hassou