Re: [Tutor] First Try 1.2

2006-02-23 Thread Alan Gauld
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

Re: [Tutor] First Try 1.2

2006-02-22 Thread John Connors
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

Re: [Tutor] First Try 1.2

2006-02-22 Thread Kent Johnson
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

Re: [Tutor] First Try 1.2

2006-02-22 Thread John Connors
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

Re: [Tutor] First Try 1.1

2006-02-21 Thread Alan Gauld
> 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?

[Tutor] First Try 1.2

2006-02-21 Thread John Connors
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

Re: [Tutor] First Try 1.1

2006-02-21 Thread Kent Johnson
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

[Tutor] First Try 1.1

2006-02-20 Thread John Connors
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

Re: [Tutor] First Try

2006-02-19 Thread Alan Gauld
> 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

Re: [Tutor] First Try

2006-02-19 Thread Todd Maynard
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

Re: [Tutor] First Try

2006-02-19 Thread Todd Maynard
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

[Tutor] First Try

2006-02-19 Thread John Connors
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