This post originated from an RSS feed registered with Ruby Buzz
by Vincent Foley.
Original Post: New conditional expression in Python
Feed Title: Uncentered Mind
Feed URL: https://gnuvince.wordpress.com/feed/?cat=2
Feed Description: I ramble, you call me names, we have fun!
Guido has posted about a new Python conditional syntax. This allows to have the condition, the then and else clause, all on the same line:
print "Odd" if odd(x) else "Even"
I’m not sure I like that syntax. Actually, I’m sure that I don’t. The two consequent clauses are around the condition, I find [...]