0

In Python language, which is the associativity of an if expression: left or right? For example if we write this:

<exp1> if <exp2> else <exp3> if <exp4> else <exp5>

what is the corresponding form?

[<exp1> if <exp2> else <exp3>] if <exp4> else <exp5>

or:

<exp1> if <exp2> else [<exp3> if <exp4> else <exp5>]
Barmar
  • 741,623
  • 53
  • 500
  • 612
Duy Duy
  • 521
  • 1
  • 4
  • 9

0 Answers0