[Tutor] what's wrong with this code

Kalle Svensson kalle@gnupung.net
Thu, 1 Mar 2001 02:12:08 +0100


--Dxnq1zWXvFF0Q93v
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Sez Katharine Stoner:
> What's wrong with this code?  I don't understand. Please help.

It's not much, in fact.  Look ahead...

> input("What is the temperature of the spam?") =3D temperature

This is where it's wrong.  The variable should be on the left side in the
assignment:

temperature =3D input("What is the temperature of the spam?")

>     if temperature > 50:
>         print "The salad is properly cooked."
>     else:
>         print "Cook the salad some more."

This should work.

Peace,
  Kalle
--=20
Email: kalle@gnupung.net     | You can tune a filesystem, but you
Web: http://www.gnupung.net/ | can't tune a fish. -- man tunefs(8)
PGP fingerprint: 0C56 B171 8159 327F 1824 F5DE 74D7 80D7 BF3B B1DD

--Dxnq1zWXvFF0Q93v
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE6naHodNeA1787sd0RAgKVAKCVpMEYddjMyIcLyiPd9gUBJjkDNwCdHtVS
ryEML4NmYiYZ5h+3RFIdZ9U=
=NSgn
-----END PGP SIGNATURE-----

--Dxnq1zWXvFF0Q93v--