On 24 Jul 2012, at 2:57 PM, villas wrote: > But why not this which seems much more readble? > > value = +1 if mode == 'plus' else -1
Originally for compatibility with Python 2.4. Not sure how much of a priority that is these days... > > > > On Tuesday, July 24, 2012 10:20:51 PM UTC+1, pjryan126 wrote: > I'm working through this same example, and I'm having trouble understanding > how the following resolves: > > value = (mode=='plus') and +1 or -1 > > Can anyone explain to me what is happening with this line of code? > > > On Monday, March 26, 2012 10:28:27 AM UTC-4, Omi Chiba wrote: > OK it worked ! > > The indent for last three line was wrong on book and it was fixed on the > downloaded code. > > > > On Friday, March 23, 2012 6:18:36 PM UTC-5, Omi Chiba wrote: > Alan, > > Thanks. Good idea. I will try the support files. > > > Sent from my Verizon Wireless BlackBerry --