[Tutor] Test

2005-02-01 Thread Mark Brown
Test, please disregard.
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Negative IF conditions

2005-02-11 Thread Mark Brown




Hi,
I'm a newbie and was wondering which of these IF conditions is better
structure:

  if not os.path.exists('filename'):
  if os.path.exists('filename') == False:

They both work so if one preferred over the other?
Thanks
Mark Brown




___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Web Calendar written in Python

2005-05-04 Thread Mark Brown
Does anyone know of a Web Calendar written in Python?
TIA
Mark

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Can anyone help me?

2005-10-28 Thread Mark Brown
Nathan,
While testing I noticed the same number coming up more that once in a 
set of 6 so what I've done:

import random
while True:
q = raw_input("Do you want a lottery number drawing? 1 for yes, 2 
for no ")
if q == '1':
numbers = []
for i in range(6):
while True:
draw = random.choice(range(1,50))
if not(numbers.count(draw)):
numbers.append(draw)
break
print numbers
elif q == '2':
break
else:
print "Read the instructions please."


Mark Brown

Nathan Pinno wrote:

>Hey,
>I created it. Want to see the code?
>Here it is:
>[code]
>import random
>numbers = []
>while True:
>q = int(raw_input("Do you want a lottery number drawing? 1 for yes, 2 
>for no "))
>if q == 1:
>for i in range(6):
>draw = random.choice(range(1,50))
>numbers.append(draw)
>print numbers
>numbers = []
>elif q == 2:
>break
>else:
>print "Read the instructions please."
>[/code]
>
>Enjoy!
>Nathan Pinno
>For great sites go to: http://falcon3166.tripod.com
>MSN Messenger: [EMAIL PROTECTED],com
>Yahoo! Messenger: spam_swatter31
>ICQ: 199020705
>AIM: f3mighty
>- Original Message - 
>From: "Alan Gauld" <[EMAIL PROTECTED]>
>To: "Nathan Pinno" <[EMAIL PROTECTED]>; 
>Sent: Friday, October 28, 2005 2:01 AM
>Subject: Re: [Tutor] Can anyone help me?
>
>
>  
>
>>Nathan,
>>
>>look at the functions in the random module.
>>randrange() would be one potential candidate.
>>
>>Alan G
>>
>>- Original Message - 
>>From: "Nathan Pinno" <[EMAIL PROTECTED]>
>>To: 
>>Sent: Friday, October 28, 2005 3:07 AM
>>Subject: [Tutor] Can anyone help me?
>>
>>
>>Hey all,
>>I am trying to create a program that draws 6 numbers between 1 and 49 at 
>>random for creating lottery tickets. I want to have a better chance when I 
>>play. Can anyone help me code this or show me how to, please?
>>Thanks,
>>Nathan Pinno
>>For great sites go to: http://falcon3166.tripod.com
>>MSN Messenger: [EMAIL PROTECTED],com
>>Yahoo! Messenger: spam_swatter31
>>ICQ: 199020705
>>AIM: f3mighty
>>
>>
>>
>___
>Tutor maillist  -  Tutor@python.org
>http://mail.python.org/mailman/listinfo/tutor
>
>
>  
>


___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor