Re: [Tutor] 2.5's new conditional expression syntax

2006-09-28 Thread wesley chun
> That's very clear. Thanks, Wesley. > And if you wanted to know which is smaller, x or y: > > x = 8**9 > y = 9**8 > smaller = "x" if x < y else "y" > print smaller, "is smaller" > > I think I'm getting the hang of it! your example is correct. if you had a background in C programming, you would r

Re: [Tutor] 2.5's new conditional expression syntax

2006-09-28 Thread Dick Moores
At 03:25 PM 9/28/2006, wesley chun wrote: >On 9/28/06, Dick Moores <[EMAIL PROTECTED]> wrote: >>I've been looking hard at 2.5's new conditional expression syntax >>(), and didn't >>understand the examples there... >> : >>But it would help to see an

Re: [Tutor] 2.5's new conditional expression syntax

2006-09-28 Thread wesley chun
On 9/28/06, Dick Moores <[EMAIL PROTECTED]> wrote: > I've been looking hard at 2.5's new conditional expression syntax > (), and didn't > understand the examples there... > : > But it would help to see an example I could understand that also > shows

Re: [Tutor] 2.5's new conditional expression syntax

2006-09-28 Thread Dick Moores
Kent, Your examples took a lot of study, but I think I'm catching on. Thanks very much. Dick At 10:53 AM 9/28/2006, Kent Johnson wrote: >Dick Moores wrote: > > I've been looking hard at 2.5's new conditional expression syntax > > (), and didn't > >

Re: [Tutor] 2.5's new conditional expression syntax

2006-09-28 Thread Kent Johnson
Dick Moores wrote: > I've been looking hard at 2.5's new conditional expression syntax > (), and didn't > understand the examples there, so I tried making up my own: > > >>> x = (1 if 2 == 2 else 3) > >>> x > 1 > >>> y = (1 if 2 == 1 else 3) > >>

[Tutor] 2.5's new conditional expression syntax

2006-09-28 Thread Dick Moores
I've been looking hard at 2.5's new conditional expression syntax (), and didn't understand the examples there, so I tried making up my own: >>> x = (1 if 2 == 2 else 3) >>> x 1 >>> y = (1 if 2 == 1 else 3) >>> y 3 >>> But it would help to see