On 2/16/07, <b class="gmail_sendername">Wolfram Kraus</b> <<a href="mailto:wolfram.kraus@fen-net.de">wolfram.kraus@fen-net.de</a>> wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On 16.02.2007 08:01, xiufeng liu wrote:<br>> Hi, all,<br>><br>> In python if there is any similar way like in Java, or C++ to express<br>> the following:<br>> str = (a>b?"Yes":"NO")<br>
><br>><br>> thanks!<br><br>In Python 2.5 you can do the following (untested):<br><br>str = "Yes" if a>b else "No"<br><br>See: <a href="http://docs.python.org/whatsnew/pep-308.html">http://docs.python.org/whatsnew/pep-308.html
</a><br><br>HTH,<br>Wolfram<br></blockquote></div><br>Before 2.5, you could generally write:<br><br>str = (a > b) and "Yes" or "No"<br><br> -Arcege<br clear="all"><br>-- <br>There's so many different worlds,
<br>So many different suns.<br>And we have just one world,<br>But we live in different ones.