3 ms·
Putting the loop in its own function would solve the problem as well (allowing you to just return the output), or if that's not an option then you need to store
by contravariant 8y ago
Putting the loop in its own function would solve the problem as well (allowing you to just return the output), or if that's not an option then you need to store the output anyway so you might as well just add a check 'if output is None:'.