Eiffel’s conditional expressions

The ternary conditional operator is a short-hand method for writing an if/else statement.

Does Python Have a Ternary Conditional Operator? Yes, it does.

This remids me that Eiffel, at least “ISE Eiffel” does actually have conditional expressions that are the same: <span class="kwd">answer := if</span><span class="pln"> time < noon </span><span class="kwd">then</span>
<span class="str">"Good morning"</span>
<span class="kwd">else "Good afternoon"</span>
<span class="kwd">end</span>

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.