Another newbe question! I use while True: to evaluate an
expression, I see that you used while 1: .. what's the diffrence if
any?!
Python only provided boolean literal values (True, False) relatively
recently.
Long time Python programmers, especially those with a C background(*)
are used to
Hello,
Can someone provide me with an error checking example about an x
variable that needs to be number only? I used something like:
def useridf():
print
print WARNING: If you don't understand why this must be unique,
exit and read the manual.
print
userid = input(x : )
At 10:15 AM 12/23/2005, Panagiotis Atmatzidis wrote:
Hello,
Can someone provide me with an error checking example about an x
variable that needs to be number only? I used something like:
def useridf():
print
print WARNING: If you don't understand why this must be unique,
exit and
Hello there,
Thank you for the prompt response.
On 12/23/05, bob [EMAIL PROTECTED] wrote:
At 10:15 AM 12/23/2005, Panagiotis Atmatzidis wrote:
Hello,
Can someone provide me with an error checking example about an x
variable that needs to be number only? I used something like:
def
x = raw_input(x : )
if x.isdigit(): # ensure input is a number
y = int(x) # convert to integer
else:
print 'Boo
Hello Bob and Panagiotis,
It might be good to make this number-reading thing a function, just to
make it easier to reuse (and test!) it. Let's call this input_number()
for
Hello Dany :-)
On 12/23/05, Danny Yoo [EMAIL PROTECTED] wrote:
x = raw_input(x : )
if x.isdigit(): # ensure input is a number
y = int(x) # convert to integer
else:
print 'Boo
Hello Bob and Panagiotis,
It might be good to make this number-reading thing a function, just to
Yeah works you're right. :-)
On 12/23/05, bob [EMAIL PROTECTED] wrote:
At 11:16 AM 12/23/2005, Panagiotis Atmatzidis wrote:
Hello there,
Thank you for the prompt response.
On 12/23/05, bob [EMAIL PROTECTED] wrote:
[snip]
print input(x ; )
and enter Hello world
x = input(x: )
At 11:16 AM 12/23/2005, Panagiotis Atmatzidis wrote:
Hello there,
Thank you for the prompt response.
On 12/23/05, bob [EMAIL PROTECTED] wrote:
[snip]
print input(x ; )
and enter Hello world
x = input(x: )
x: hello world
Traceback (most recent call last):
File stdin, line 1, in ?
On 12/23/05, Panagiotis Atmatzidis [EMAIL PROTECTED] wrote:
Hello Dany :-)
On 12/23/05, Danny Yoo [EMAIL PROTECTED] wrote:
[...]
Hello Bob and Panagiotis,
It might be good to make this number-reading thing a function, just to
make it easier to reuse (and test!) it. Let's call this
Panagiotis Atmatzidis wrote:
Hello,
Can someone provide me with an error checking example about an x
variable that needs to be number only? I used something like:
def useridf():
print
print WARNING: If you don't understand why this must be unique,
exit and read the manual.
At 11:28 AM 12/23/2005, Panagiotis Atmatzidis wrote:
On 12/23/05, Panagiotis Atmatzidis [EMAIL PROTECTED] wrote:
Hello Dany :-)
On 12/23/05, Danny Yoo [EMAIL PROTECTED] wrote:
[...]
Hello Bob and Panagiotis,
It might be good to make this number-reading thing a function, just
11 matches
Mail list logo