Just for the heck of it:
heads = sum(random.randrange(2) for i in range(100))
--
Bob Gailer
919-636-4239
Chapel Hill NC
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tuto
"Stephanie Dawn Samson" wrote
thought I should write the rewritten code I got that others helped
me get to
By applying a couple of other ideas that have been suggested you get
something shorter and arguably slightly clearer:
# Coin Flips
# The program flips a coin 100 times and then
# tell
"Patty" wrote
then I went through Alan Gauld's tutorial which also helped.
Glad to hear it :-)
If I just can't figure out how to do this with Tkinter and the
Python
I can send some basic code if that would help...
Imaging Library, is 'wxPython' the additional software I would want
to
Greetings,
As a thread starter, I thought I should write the rewritten code I got that
others helped me get to, since this thread is still going on.
# Coin Flips# The program flips a coin 100 times and then# tells you the number
of heads and tailsimport random
print "\a"print "\tWelcome to 'Coi
Not wanting to hijack Terry's conversation, but for what it's worth:
On 16 November 2010 18:08, Patty wrote:
> If I just can't figure out how to do this with Tkinter and the Python
> Imaging Library, is 'wxPython' the additional software I would want to
> install and try with? Is its purpose to
On Tue, 16 Nov 2010, Patty wrote:
Hi Terry - I am an alumni of UCSC (University of California, Santa Cruz)
and live really close so I can request books throughout the UC system
just like you describe and there is no limit - or maybe an extremely
high limit - to the number of books I can check
Hi Terry - I am an alumni of UCSC (University of California, Santa Cruz) and
live really close so I can request books throughout the UC system just like
you describe and there is no limit - or maybe an extremely high limit - to
the number of books I can check out from McHenry Library. It is so
Thankyou..!!!
Regards,
Nithya
On Tue, Nov 16, 2010 at 1:51 PM, Luke Pettit wrote:
> Arrr thats better Nithya it works fine now. I had it working fine before
> it was just coming up with that strange result of 73 and 100
> when I copied the code into wing to check it out in order to understand
On Fri, Oct 8, 2010 at 1:11 AM, Alan Gauld wrote:
>
> "roberto" wrote
>
>> is it correct to overwrite the turtle.py and turtle.pyc files
>
> I'd overwrite the .py file but get Python to generate a new .pyc for you
> just to ensure compatibility.
>
> just type import turtle at the >>> prompt.
>
t
Arrr thats better Nithya it works fine now. I had it working fine before it
was just coming up with that strange result of 73 and 100
when I copied the code into wing to check it out in order to understand it.
Wing picked up the spacing and I had already corrected
that Dave as I was simply looking
Hi there,
This is the Code. Please check it.It is working fine.
>>>import random
>>>headsCount = 0
>>>tailsCount = 0
>>>count = 1
>>>
>>>while count <= 100:
>>> coin = random.randrange(2)
>>> if coin == 0:
>>> headsCount += 1
>>> else:
>>> tailsCount += 1
11 matches
Mail list logo