March 2003
Intermediate to advanced
656 pages
39h 30m
English
input
input(prompt='')
input(
prompt
)
is a shortcut for
eval(raw_input(
prompt
)).
In other words, input prompts the user for a line
of input, evaluates the resulting string as an expression, and
returns the expression’s result. The implicit
eval may raise SyntaxError or
other exceptions. input is therefore rather
user-unfriendly and not appropriate for most programs, but it can be
handy for experiments and your own test scripts. See also
eval and raw_input in this
section.