jeudi 15 février 2018

How to optimise multiple if in python/django? [duplicate]

This question already has an answer here:

Simply I just want to know, is there any way to optimise multiple if statements especially in case of below scenario:

if var1:
    do something1
if var2:
    do something2
if var3:
    do something3
......
......
if varN:
    do somethingN

Solution for this will be highly appreciable.

Regards,

Shubham Kumar Rohit

Aucun commentaire:

Enregistrer un commentaire