generator - Does python yield imply continue? -


I have a loop that checks a series of conditions, on each iteration, it yields output for only one condition needed. The final yield is a default, if none of the conditions is true. Do any of the following after each block of production: continue

  DIF function (): AI in AI: if condition 1 (ii): yield 1 some produce yield some 2 yield Some 3 if condition 2 (ii): yield some 4 release #default yield some 5 release    

< Instead of using the

Continue statement, I can suggest using the alif and else conditions:

< Pre> def function (): For AI: If condition 1 (ii): yield yields some 1 G-2 to produce a 3 Elif position 2 (ii): Some yield 4: #default yield something5

It is much more readable I


Comments