Hi John,
Its developing nicely so I'll add some more style issue comments :-)
> import random
>
> # store the /home/mutt/lotto.txt in f
> f = file('/home/mutt/lotto.txt','w')
> # create or replace lotto.txt in my home directory
> f.write('Here are your numbers:\n\n')
I'd move the middle comment
G'day Kent,
Thanks for the input.
>The comments don't really add anything to the program. Comments that
>restate exactly what the code is doing are not that helpful. The code
>should be clear by itself. As a beginner they may seem like a helpful
>crutch but you will get better at reading the cod
John Connors wrote:
> import random
>
> # store the /home/mutt/lotto.txt in f
> f = file('/home/mutt/lotto.txt','w')
> # create or replace lotto.txt in my home directory
> f.write('Here are your numbers:\n\n')
>
The comments don't really add anything to the program. Comments that
restate exactl
G'day,
Added a power ball option to the lotto program today. The program does way
more then I ever intended when I started it so I'll try a new project. Maybe
I'll come back to it when I try out Tkinter and try to give it a GUI.
Anywayhere's my latest effort.
import random
# store the /h
> I understand that the "else" is not neccessary for the program to work but
> should I include it to show the end of the loop? I guess it's not
> important in a program like this that has only 1 loop but maybe it makes
> reading more complcated programs easier or is the indentation sufficient?
G'day :)
I've added a little more to the program. It now sorts the game numbers from
lowest to highest which makes filling out the tickets a lot easier, I've
been putting off doing this because I wasn't sure how to go about it but
once I started looking I found python does it all for me with .s
John Connors wrote:
> I understand that the "else" is not neccessary for the program to work
> but should I include it to show the end of the loop? I guess it's not
> important in a program like this that has only 1 loop but maybe it makes
> reading more complcated programs easier or is the inde
G'day,
Thanks for the input on my lotto number selector program, very much
appreciated and I learnt a lot. I've (hopefully) cleaned it up a little, and
expanded it to write the numbers to a text file. I'm sure there must be a
better way of doing it then the way I have.
I understand that the
> I started getting sick of reading tutorials so for a bit of a break I set
> myself the task of writing a program to pick lotto numbers,
Thats always a good idea! :-)
Sometimes you discover you don't know enough to finish it
but you can always go back, but in this case
> So I was prepared f
and for a belated footnote:
[1] = http://www.python.org/peps/pep-0008.html
Style Guide for python code.
--Todd
On Sunday 19 February 2006 06:27, Todd Maynard wrote:
> Nice Job John. I made a few comments below on a few things I noticed.
>
> On Sunday 19 February 2006 05:33, John Connors wr
Nice Job John. I made a few comments below on a few things I noticed.
On Sunday 19 February 2006 05:33, John Connors wrote:
> G'day :)
>
> I started getting sick of reading tutorials so for a bit of a break I set
> myself the task of writing a program to pick lotto numbers, 6 numbers
> betwee
G'day :)
I started getting sick of reading tutorials so for a bit of a break I set
myself the task of writing a program to pick lotto numbers, 6 numbers
between 1 and 44 (inclusive). I had done this many years before in basic and
I thought back then it would be a simple task but I struck a prob
12 matches
Mail list logo