Struggling with basics

2005-09-25 Thread Jason
A week ago I posted a simple little hi-score routine that I was using to learn Python. I've only just managed to examine the code, and the responses that people gave, and I'm now seriously struggling to understand why things aren't working correctly. At present my code is as follows...

Re: Struggling with basics

2005-09-25 Thread Reinhold Birkenfeld
Jason wrote: A week ago I posted a simple little hi-score routine that I was using to learn Python. I've only just managed to examine the code, and the responses that people gave, and I'm now seriously struggling to understand why things aren't working correctly. At present my code is

Re: Struggling with basics

2005-09-25 Thread Duncan Booth
Jason wrote: My first problem (lack of understanding of course) is that if I run the above, I get an error saying: print %s - %s % name,score TypeError: not enough arguments for format string Now I understand what it's saying, but I don't understand why. The problem is

Re: Struggling with basics

2005-09-25 Thread Peter
Jason wrote: A week ago I posted a simple little hi-score routine that I was using to learn Python. I've only just managed to examine the code, and the responses that people gave, and I'm now seriously struggling to understand why things aren't working correctly. At present my code is as

Re: Struggling with basics

2005-09-25 Thread Peter
Peter wrote: Jason wrote: A week ago I posted a simple little hi-score routine that I was using to learn Python. I've only just managed to examine the code, and the responses that people gave, and I'm now seriously struggling to understand why things aren't working correctly. At present

Re: Struggling with basics

2005-09-25 Thread Jason
Rather than reply to those individuals, just a big thanks to those that have helped. It's definitely making sense, the fact that I need to show the two-element tuple to show correctly was one of those head-slapping moments. And Dennis Lee Bieber hit the nail on the head when he mentioned that

Re: Struggling with basics

2005-09-25 Thread Peter
Duncan Booth wrote: Jason wrote: My first problem (lack of understanding of course) is that if I run the above, I get an error saying: print %s - %s % name,score TypeError: not enough arguments for format string Now I understand what it's saying, but I don't understand why.

Re: Struggling with basics

2005-09-25 Thread Reinhold Birkenfeld
Jason wrote: Rather than reply to those individuals, just a big thanks to those that have helped. It's definitely making sense, the fact that I need to show the two-element tuple to show correctly was one of those head-slapping moments. And Dennis Lee Bieber hit the nail on the head

Re: Struggling with basics

2005-09-25 Thread Jason
Reinhold Birkenfeld wrote: Jason wrote: Rather than reply to those individuals, just a big thanks to those that have helped. It's definitely making sense, the fact that I need to show the two-element tuple to show correctly was one of those head-slapping moments. And Dennis Lee Bieber

Re: Struggling with basics

2005-09-25 Thread Peter
Peter wrote: Peter wrote: Jason wrote: A week ago I posted a simple little hi-score routine that I was using to learn Python. I've only just managed to examine the code, and the responses that people gave, and I'm now seriously struggling to understand why things aren't working

Re: Struggling with basics

2005-09-25 Thread Tom Anderson
On Sun, 25 Sep 2005, Jason wrote: A week ago I posted a simple little hi-score routine that I was using to learn Python. I've only just managed to examine the code, and the responses that people gave, and I'm now seriously struggling to understand why things aren't working correctly.

Re: Struggling with basics

2005-09-25 Thread Jason
Tom, best explanation yet! Entertaining as well as educational. The %05i trick is very neat, must remember that one! Everything working a charm apart from the viewScores is still returning the results from the lowest score (at the top) to the highest score. What I'd like to know is do you

Re: Struggling with basics

2005-09-25 Thread George Sakkis
Jason [EMAIL PROTECTED] wrote: What I'd like to know is do you think it would be better to sort the list in memory, or print it out sorted? If the latter, then naturally I'd need to change the showScores section to show the list in a reverse order. But, would sorting the list in memory be

Re: Struggling with basics

2005-09-25 Thread Jason
George Sakkis wrote: Jason [EMAIL PROTECTED] wrote: What I'd like to know is do you think it would be better to sort the list in memory, or print it out sorted? If the latter, then naturally I'd need to change the showScores section to show the list in a reverse order. But, would sorting