[Tutor] Calculator functions part II

Josh Gregorio jgregorio@qwest.net
Thu, 21 Jun 2001 21:48:21 -0700


Cool. I didn't know that. Is it generally better to convert strings to
integers, rather than use input()? When would input() be appropriate?
Thanks,
Josh

----- Original Message -----
From: <sill@optonline.net>
To: <tutor@python.org>
Sent: Wednesday, June 20, 2001 9:43 PM
Subject: Re: [Tutor] Calculator functions part II


> On Wed, Jun 20, 2001 at 09:13:04PM -0700, Josh Gregorio wrote:
> > Here is what I did:
> >
> > a = input("First number" )
> > b = input("Second number" )
> > answer = a * b
> > print "The answer is %d " % (answer)
> >
> > This worked on my box. Was there a reason to use raw_input?
> >
> > Josh
>
> input() executes results so if you make a typo it may mess up your program
> or even delete files (that'd be quite a typo though). Also, it may be a
security
> threat.
>
> --
> Jupiter and Saturn Oberon Miranda
> And Titania Neptune Titan
> Stars can frighten
>         - Syd
>
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>