473,386 Members | 1,674 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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 1822
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

58
by: Jeff_Relf | last post by:
Hi Tom, You showed: << private const string PHONE_LIST = "495.1000__424.1111___(206)564-5555_1.800.325.3333"; static void Main( string args ) { foreach (string phoneNumber in Regex.Split...
6
by: WindAndWaves | last post by:
Hi Gurus In my quest in putting my first javascript together, I am now trying to conquer something that seems trivial, but has taken me hours. I would like to format a field in a form once the...
3
by: Jerome Cohen | last post by:
AI am trying to call a third-party web service. this service expects an XML fragment that contains the request plus other parameter. adding the web reference created the syntax below(reference.vb)....
1
by: Dominik Szczurek | last post by:
Hello to anyone who is tring to help me :-) As I was writed in the topic I have problem when somone input 0 value in the form. PHP is losting this value when it try to write it to mySQL. I have...
18
by: Seeker | last post by:
I essentially copied this program from K&R: #include <stdio.h> #include <stdlib.h> int main() { int c;
3
by: G | last post by:
Hello, I would like look at a user-entered string, and copy all characters starting from the left until a number is found. As soon as a number is detected, the copy should stop and the...
9
by: weirdwoolly | last post by:
Hopefully someone will be able to help. I have written a stored procedure in C++ called from a Java test harness to validate the graphic data types in C++ and their use. I have declared the...
24
by: kindrain | last post by:
the code checks whether a.txt has exact the same lines, then write different lines into b.txt Here it is: (before that ,you should creat a.txt) ---------------------- #include<stdio.h>...
1
tlhintoq
by: tlhintoq | last post by:
I'm pretty sure this is language independent and is going to be the same whether it's VC or C# - but my project is C# WIndows Forms just in case. Does anyone have a good handle on the sequence of...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.