The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

import-bot (20211) [Avatar] Offline
#1
[Originally posted by infotechsys]

Hello,
Can someone explain how the "lambda" value can associate to
the key "degF" when the call is made?
>>> t2['FtoK'](32)
Thanks.
Wayne
import-bot (20211) [Avatar] Offline
#2
Re: futher explaination of page 101
[Originally posted by infotechsys]

> Hello,
> Can someone explain how the "lambda" value can associate to
> the key "degF" when the call is made?
> >>> t2['FtoK'](32)
> Thanks.
> Wayne
Hi again,
I also notice that I'm getting a Sysntax Error when I key in the example.

>>> t2 = { 'FtoK' : lambda, degF : 273.15 + (degF - 32) * 5/9.0,
^
SyntaxError: invalid systax

What am I doing wrong?
Wayne
import-bot (20211) [Avatar] Offline
#3
Re: futher explaination of page 101
[Originally posted by slbaumgartner]

> > Hello,
> > Can someone explain how the "lambda" value can associate to
> > the key "degF" when the call is made?
> > >>> t2['FtoK'](32)
> > Thanks.
> > Wayne
> Hi again,
> I also notice that I'm getting a Sysntax Error when I key in the example.
>
> >>> t2 = { 'FtoK' : lambda, degF : 273.15 + (degF - 32) * 5/9.0,
> ^
> SyntaxError: invalid systax
>
> What am I doing wrong?
> Wayne

The answer to both your questions is the same: the comma following 'lambda' is
a typo (two places) that makes degF look like a second key instead of the
formal argument name to the lambda. It gets the value 32 when invoked as
shown.

Steve