Home>
About python goIf

I read Qiita's article about pythongolf, and I was unable to understand it. In the code below, why is b assigned when a Applicable source code

c = a<b and a or b
What you could see and understand

And and or can be used for other than Boolean values. And and or can be used even if not in an if statement.
-If the left of or is "true", return the left value.-If the left of or is "false", return the right value.
・ If the left side of "and" is "true", the right value is returned. ・ If the left side of "and" is "false", the left value is returned.

How do you think it works
  1. Compare a and b (False)
  2. If the left of "and" is "false", the left value is returned, so False is assigned