[Tutor] what's wrong with this code

Jörg Wölke lumbricus@gmx.net
Thu, 1 Mar 2001 01:51:54 +0100 (MET)


This is a multi-part message in MIME format.


------=_NextPart_000_0005_01C0A1AF.963E7C00
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 8bit

> What's wrong with this code?  I don't understand. Please help.
> 
> input("What is the temperature of the spam?") = temperature
> 
>     if temperature > 50:
>         print "The salad is properly cooked."
>     else:
>         print "Cook the salad some more."
> 
> -Cameron Stoner
> 
try "temperature=input("What...")"  ;-)
assignments go: assign value (on the right side of the assignment operator)
to variable (on the left side) just like in C or AFAIK any other language.
input() is evaluated and the result assigned to variable "temperature".
greeeetz jö!

-- 
Sent through GMX FreeMail - http://www.gmx.net
------=_NextPart_000_0005_01C0A1AF.963E7C00
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2614.3500" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>What's wrong with this code?&nbsp; I=20
don't&nbsp;understand. Please help.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>input("What is the temperature of the =
spam?") =3D=20
temperature</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; if temperature &gt;=20
50:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print "The salad is =
properly=20
cooked."<BR>&nbsp;&nbsp;&nbsp;=20
else:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print "Cook the =
salad some=20
more."</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>-Cameron =
Stoner</FONT></DIV></BODY></HTML>

------=_NextPart_000_0005_01C0A1AF.963E7C00--


_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor