Rather than declaring a list at the start of the method, adding to it and then returning it – I’m sure there’s some shorthand return statement that can be written in a loop, for example, to save the extra code (declaring etc.) but I’ve forgot it. Anybody know what I mean?
Share
Use
yield: