Which case is generally better to use in terms of readability, efficiency, etc.
One: repeat the same conditions multiple times (no code is repeated)
instr1
instr2
if condition:
instr3a
else:
instr3b
instr4
if condition:
instr5a
else:
instr5b
etc..
Two: Enclose the whole statement in the condition and repeat code
if condition:
instr1
instr2
instr3a
instr4
instr5a
else:
instr1
instr2
instr3b
instr4
instr5b
etc..
Just by looking at it, the second seems more readable and only having a single condition must be faster to run, but what is the best practice regarding this?