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 same and when
an integer in not entered,in that case how are they different?????
In response to an input() call in Python 2.x, you can type

    sys.exit()

Generally it gives your user enough rope to shoot himself in the foot.

And here is the code running under 3.0 and 3.1rc2 (release candidate #2)
    a, b = (int(t) for t in input('Numbers: ').split())

--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to