Making an iterator out of a function (mathspp.com)
from learnbyexample@programming.dev to python@programming.dev on 19 Jul 2024 14:36
https://programming.dev/post/17071685

#python

threaded - newest

rutrum@lm.paradisus.day on 19 Jul 2024 20:40 next collapse

Idk…kind of neat, but is the die rolling example any better than just doing ‘while roll() != 6:’?

FizzyOrange@programming.dev on 19 Jul 2024 21:54 collapse

Yeah I would avoid this. The meaning is not obvious and at least in the examples given there are far better ways to do it.