By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,772 Members | 961 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,772 IT Pros & Developers. It's quick & easy.

When does input() return an empty string?

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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.