I have a block of code which I do not want to wrap in a function. Let's call that block of code block. Here's what I want to do:
check = True
for loop:
if (check):
execute block
else:
if (another condition):
execute block
I want to execute block anyway, but if a certain variable is False, I would like to place a check to limit the amount of times block is executed which is determined by another condition. I can copy and paste the block and have a code that resembles the pseudo-code above, however the block is more than 30 lines of code and I do not want to copy and paste it.
Let me know if I have clarified myself enough or I need to explain things a better.
Aucun commentaire:
Enregistrer un commentaire