mardi 28 août 2018

Python - is there a more elegant way of writing these if statements

I have a plot on which I want to plot either diagram A, or diagram B, or both.

Currently my structure is:

if bool_A:
 plot A
 if bool_B:
  plot B
elif bool_B:
 plot B
 if bool_A:
  plot A

Is there a more concise / more elegant way?

Aucun commentaire:

Enregistrer un commentaire