## [Jython-users] Help with an output (simple question)

 [Jython-users] Help with an output (simple question) From: od11kd - 2013-02-02 20:52:23 ```Hey guys! So I am trying to do a program, and for the most part I have it down except for 1 part of it. Basically, we are to to write a single function, which will continue to prompt a user to enter an integer number between 1 and 100 inclusive, until the user enters a invalid integer. I have the program here: def assign2PartB(): x = 0 while x <= 100: x = input ("Enter a number between 1 and 100 to continue: ") printNow ("The number you entered was: " + str(x)) if x <=0: printNow ("The number you entered (" + str(x) + ") was not between 1 and 100. Try again, please!") And the output is as followed: >>> assign2PartB() Enter a number between 1 and 100 to continue: 19 The number you entered was: 19 Enter a number between 1 and 100 to continue: 99 The number you entered was: 99 Enter a number between 1 and 100 to continue: 0 *The number you entered was: 0* The number you entered (0) was not between 1 and 100. Try again, please! My question is, when I enter "0" how do I get my program to not show "The number you entered was: 0" but only show "The number you entered (0) was not between 1 and 100. Try again, please!" Thanks so much in advance guys, I appreciate your help! -- View this message in context: http://python.6.n6.nabble.com/Help-with-an-output-simple-question-tp5004433.html Sent from the jython-users mailing list archive at Nabble.com. ```

 [Jython-users] Help with an output (simple question) From: od11kd - 2013-02-02 20:52:23 ```Hey guys! So I am trying to do a program, and for the most part I have it down except for 1 part of it. Basically, we are to to write a single function, which will continue to prompt a user to enter an integer number between 1 and 100 inclusive, until the user enters a invalid integer. I have the program here: def assign2PartB(): x = 0 while x <= 100: x = input ("Enter a number between 1 and 100 to continue: ") printNow ("The number you entered was: " + str(x)) if x <=0: printNow ("The number you entered (" + str(x) + ") was not between 1 and 100. Try again, please!") And the output is as followed: >>> assign2PartB() Enter a number between 1 and 100 to continue: 19 The number you entered was: 19 Enter a number between 1 and 100 to continue: 99 The number you entered was: 99 Enter a number between 1 and 100 to continue: 0 *The number you entered was: 0* The number you entered (0) was not between 1 and 100. Try again, please! My question is, when I enter "0" how do I get my program to not show "The number you entered was: 0" but only show "The number you entered (0) was not between 1 and 100. Try again, please!" Thanks so much in advance guys, I appreciate your help! -- View this message in context: http://python.6.n6.nabble.com/Help-with-an-output-simple-question-tp5004433.html Sent from the jython-users mailing list archive at Nabble.com. ```