469,282 Members | 1,977 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,282 developers. It's quick & easy.

When does input() return an empty string?

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?

May 3 '07 #1
2 1635
On May 3, 8:43 pm, noagbodjivic...@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é

May 3 '07 #2
On May 3, 7:50 pm, André <andre.robe...@gmail.comwrote:
On May 3, 8:43 pm, noagbodjivic...@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é
Thanks

May 3 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by WindAndWaves | last post: by
3 posts views Thread by Jerome Cohen | last post: by
24 posts views Thread by kindrain | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.