[Python] Bug asking for input number
Nov 16, 2013 at 3:03 am
MRAB your solution is good thank you I will use it.
Terry Eddy I saw my mistake about for example 2 <= 2, I think it's easier to use break in this case thank you!
: On 11/15/2013 08:15 PM, Arturo B wrote:> Hi! I hope you can help me. > and it keeps asking for a valid number. > > You only set 'hundreds' and 'ones' the first time, when the loop goes around those values never change. Also, I don't see any .isdigit() before you call int(), which may make it error (maybe you just didn't post the full code?). Also, I think your <= is flipped the wrong way. The difference should be greater than or equal to 2 right? Try something like this: def is_valid_input(s)
: Sorry about my previous post, gmane is being really slow. :( I wouldn't have posted if I knew the question was already answered. -- - Christopher Welborn http://welbornprod.com
Dynamically naming objects.
Python 2.5: wrong number of arguments given in TypeError for function argument aggregation (dictionary input vs the norm)
PDFBuilder can now handle unlimited input files
help in obtaining binary equivalent of a decimal number in python
First python program, syntax error in while loop
Guess the Number Repeat
Processing user input as it's entered
Insert comma in number?
5 of 6
Nov 16, '13 at 2:15a
Nov 16, '13 at 3:15a
4 users in discussion
Arturo B (2)
Christopher Welborn (2)
Terry Reedy (1)
Groups & Organizations
site design / logo © 2022 Grokbase