[Tutor] Calculator functions

Michael Schmitt lgwb@home.com
Wed, 20 Jun 2001 22:07:41 -0500


This is a multi-part message in MIME format.

------=_NextPart_000_00EC_01C0F9D5.6CD4CE90
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

I think what you want is:

a =3D raw_input ("First Number:")
b =3D raw_input ("Second Number:")
print "Answer: %d" % (int(a)*int(b))


Michael Schmitt

  ----- Original Message -----=20
  From: Brendhan Horne=20
  To: tutor@python.org=20
  Sent: Wednesday, June 20, 2001 8:47 PM
  Subject: [Tutor] Calculator functions


  I have been reading the non programmers guide and it has been helpful =
but I think a point is just over my head. Here is what I am looking for:
  Things in Parenthesis are my notes on what I want to happen.



  First Number:    ( You than enter a single digit number from 0-9 )
  Second Number:   ( You than enter a single digit number from 0-9 )
  Answer:                  ( The  Product of First Number multiplied by =
Second Number )




  I am thinking:
  a =3D raw_input ("First Number:")
  b =3D raw_input ("Second Number:")
  a*b =3D raw_input ("Answer:")
  but my thinking is not quite there a little help if you could. Thanks =
in advance.
  Thanks,
  Brendhan
  -----BEGIN GEEK CODE BLOCK-----
  Version: 3.1
  GE d- s: a C++ U(++) P(++) L+(++) E- W+ N+ o+ K- w+
  O+ M V? PS+ Y PGP(++) t++ 5++ X- R+++ tv++ b+++ DI++
  D G(++) e+(++) h-- r++ y++*
  ------END GEEK CODE BLOCK------

------=_NextPart_000_00EC_01C0F9D5.6CD4CE90
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 http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 5.50.4134.600" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT size=3D2>I think what you want is:</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>a =3D raw_input ("First Number:")<BR>b =3D raw_input =
("Second=20
Number:")<BR>print "Answer: %d" % (int(a)*int(b))</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV>Michael Schmitt<BR></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV style=3D"FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV=20
  style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: =
black"><B>From:</B>=20
  <A title=3Dbrendhanhorne@hotmail.com=20
  href=3D"mailto:brendhanhorne@hotmail.com">Brendhan Horne</A> </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>To:</B> <A title=3Dtutor@python.org =

  href=3D"mailto:tutor@python.org">tutor@python.org</A> </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Wednesday, June 20, 2001 =
8:47=20
  PM</DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Subject:</B> [Tutor] Calculator=20
  functions</DIV>
  <DIV><BR></DIV>
  <DIV><FONT size=3D2>I have been reading the non programmers guide and =
it has=20
  been helpful but I think a point is just over my head. Here is what I =
am=20
  looking for:</FONT></DIV>
  <DIV><FONT size=3D2>Things in Parenthesis are my notes on what I want =
to=20
  happen.</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT size=3D2>First Number:&nbsp;&nbsp;&nbsp; ( You than enter a =
single=20
  digit number from 0-9 )</FONT></DIV>
  <DIV><FONT size=3D2>Second Number:&nbsp;&nbsp; ( You than enter a =
single digit=20
  number from 0-9 )</FONT></DIV>
  <DIV><FONT=20
  =
size=3D2>Answer:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  ( The&nbsp; Product of First Number multiplied by Second Number =
)</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT size=3D2>I am thinking:</FONT></DIV>
  <DIV><FONT size=3D2>a =3D raw_input ("First Number:")</FONT></DIV>
  <DIV><FONT size=3D2>b =3D raw_input ("Second Number:")</FONT></DIV>
  <DIV><FONT size=3D2>a*b =3D raw_input ("Answer:")</FONT></DIV>
  <DIV><FONT size=3D2>but my thinking is not quite there a little help =
if you=20
  could. Thanks in advance.</FONT></DIV>
  <DIV><FONT size=3D2>Thanks,<BR>Brendhan<BR>-----BEGIN GEEK CODE=20
  BLOCK-----<BR>Version: 3.1<BR>GE d- s: a C++ U(++) P(++) L+(++) E- W+ =
N+ o+ K-=20
  w+<BR>O+ M V? PS+ Y PGP(++) t++ 5++ X- R+++ tv++ b+++ DI++<BR>D G(++) =
e+(++)=20
  h-- r++ y++*<BR>------END GEEK CODE=20
BLOCK------</FONT></DIV></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_00EC_01C0F9D5.6CD4CE90--