On Thu, Aug 20, 2009 at 3:24 AM, baalu aanand<baaluaan...@gmail.com> wrote: > Hi, > > I have used both raw_input() and input() for a same input value. > But these gives different output. > > I have listed below what actually I have done > > >>> a = raw_input("===>") > ===> 023 > >>> a > '023' > > I have given the same value for the input() but it gives 19 as > result > >>> a = input("===>") > ===> 023 > >>> a > 19 > > Is there anything hide within this. Please illustrate the difference > between raw_input() and input()
input() === eval(raw_input()) eval("023") --> int("23", 8) --> 19 [an integer, not a string] raw_input() /always/ returns a string. Never use input() in Python 2.x. In Python 3, raw_input() was renamed to input() because it's a better name and the old input() was hardly ever used (correctly). Cheers, Chris -- http://blog.rebertia.com -- http://mail.python.org/mailman/listinfo/python-list