Reputation: 1
I have been trying to optimise this, but since each if has its own condition, i am not able to reduce its complexity
for () in ():
if ():
if ():
#Logical condition
if ():
#Logical condition
else:
#Logical condition
#another condition
if ():
if ():
if ():
#Logical condition
if index in ():
#Logical condition
Upvotes: 0
Views: 50
Reputation: 4391
Logic operators are your friend. and
, or
, xor
, etc
for () in ():
if () and ():
#Logical condition
if ():
#Logical condition
pass
else:
#Logical condition
pass
#another condition
if () and () and () and index in ():
#Logical condition
pass
Upvotes: 1