BASIC vs Python

Fredrik Lundh fredrik at pythonware.com
Sun Dec 19 15:32:45 EST 2004


Andrew Dalke wrote:

> That is, I'm looking for something that would have let me
> (were I 20 years younger and just starting to program)
> do one of the "songs" I made in the early 1980s where I
> generated notes at random.  It was something like:
>
>  randomize
>  for i=1 to 1000 do
>    call sound(10, int(262+262*RND))
>  next i

import random, winsound

for i in range(1000):
    winsound.Beep(int(262+262*random.random()), 10)

</F> 






More information about the Python-list mailing list