Re: Input problem

2009-06-19 Thread Prasoon
What is the difference between z=int(raw_input()) and z=eval(raw_input())(I thought them to be the same in case of integers) I mean when an integer is entered in that case are they same and when an integer in not entered,in that case how are they different? -- http://mail.python.org/mai

Re: Input problem

2009-06-16 Thread Piet van Oostrum
> Lie Ryan (LR) wrote: >LR> Piet van Oostrum wrote: Prasoon (P) wrote: >>> >P> What is the difference between >P> z=int(raw_input()) and z=eval(raw_input())(I thought them to be >P> the same in case of integers) >>> >P> I mean when an integer is entered in that case are they s

Re: Input problem

2009-06-16 Thread Lie Ryan
Piet van Oostrum wrote: >> Prasoon (P) wrote: > >> P> What is the difference between >> P> z=int(raw_input()) and z=eval(raw_input())(I thought them to be >> P> the same in case of integers) > >> P> I mean when an integer is entered in that case are they same and when >> P> an integer in

Re: Input problem

2009-06-16 Thread Piet van Oostrum
> Prasoon (P) wrote: >P> What is the difference between >P> z=int(raw_input()) and z=eval(raw_input())(I thought them to be >P> the same in case of integers) >P> I mean when an integer is entered in that case are they same and when >P> an integer in not entered,in that case how are they

Re: Input problem

2009-06-16 Thread Scott David Daniels
Prasoon wrote: What is the difference between z=int(raw_input()) and z=eval(raw_input())(I thought them to be the same in case of integers) Note that you can (and probably should) provide a prompt as an arg to input and raw_input. I mean when an integer is entered in that case are they s

Re: Input problem

2009-06-16 Thread Prasoon
On Jun 16, 3:34 pm, Francesco Bochicchio wrote: > On 16 Giu, 11:32, Prasoon wrote:> I am new to > pythonand using python 2.6 > > I want to know when to use raw_input( ) and when to use input( )??? > > > According to my interpretation one should use input( ) when entering > > numbers etc and

Re: Input problem

2009-06-16 Thread Francesco Bochicchio
On 16 Giu, 11:32, Prasoon wrote: > I am new to pythonand using python 2.6 > I want to know when to use raw_input( ) and when to use input( )??? > > According to my interpretation one should use input( ) when entering > numbers etc and > raw_input( ) when a string is too be entered. > > Cor

Re: Input problem

2009-06-16 Thread Bearophile
Prasoon: > I am new to pythonand using python 2.6 > I want to know when to use raw_input( ) and when to use input( )??? I think it's better to always use raw_input(), and then convert the string to the data to work on. Once in a while you may want to use input() to input expressions (like for