[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: code snippet
"Dick Jackson" <dick@d-jackson.com> writes:
> choice = (['first','second','third','fourth'])[key]
Heh heh, and just to be archane, why not try these:
choice = (['first','second','third','fourth'])(key)
choice = (['first','second','third','fourth'])([key])
choice = (['first','second','third','fourth'])[(key)]
One of these four expressions has a slightly different meaning than
the other. As a trivia test to the newer users of IDL on the
newsgroup (or the older ones!), can you say which one is different?
[ And why ? ]
Craig
--
--------------------------------------------------------------------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
--------------------------------------------------------------------------