conditional with multiples operations inside

64 Views Asked by At

I have a python script and I want to write them mathematically, the conditional is:

if a>b:
  a=5
  b=3
elif a<b:
  a=0
  b=5
else:
  a=2
  b=0

How can I do that?

Thanks.

1

There are 1 best solutions below

0
On

can I write?

$$ a= \begin{cases} 5,b=3 &if \: a>b\\ 0,b=5 &if \: a<b\\ 2,b=0 &otherwise\\ \end{cases} $$