Python Developer — Hard
Key points
- The generator expression `(x * 2 for x in range(4))` multiplies each value of `x` by 2.
- `next(gen)` retrieves the next value from the generator.
- The first call to `next(gen)` returns 0, and the second call returns 2.
Ready to go further?
Related questions
