When does input() return an empty string?

André andre.roberge at gmail.com
Thu May 3 19:50:47 EDT 2007


On May 3, 8:43 pm, noagbodjivic... at gmail.com wrote:
> I'm filling an array with user input, I want an empty string to be
> returned when nothing is entered; ie return key hit twice... How do I
> do that?

use raw_input(), not input().  input() attempts to evaluate the
result, assuming it is a valid python expression.

André




More information about the Python-list mailing list